Input / Output

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

float a=3.14;
double b=3.14;

A printf("%f %lf", a, b);

B printf("%f %Lf", a, b);

C printf("%Lf %f", a, b);

D printf("%Lf %Lf", a, b);

ANS:A - printf("%f %lf", a, b);

To print a float value, %f is used as format specifier. To print a double value, %lf is used as format specifier. Therefore, the answer is printf('%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.