Input / Output

Q1:
To scan a and b given below, which of the following scanf() statement will you use?
#include<stdio.h>

float a;
double b;

A scanf("%f %f", &a, &b);

B scanf("%Lf %Lf", &a, &b);

C scanf("%f %Lf", &a, &b);

D scanf("%f %lf", &a, &b);

ANS:A - scanf("%f %f", &a, &b);

To scan a float value, %f is used as format specifier. To scan a double value, %lf is used as format specifier. Therefore, the answer is scanf("%f %lf", &a, &b);



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.