Home » C Programming » Input / Output

To print out a and b given below, which of the following printf() statement will you use? #include float a=3.14; double b=3.14;

Correct Answer: printf("%f %lf", a, b);

Explanation:

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);


← Previous Question Next Question→

More Questions from Input / Output

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion