Home » C Programming » Input / Output

To scan a and b given below, which of the following scanf() statement will you use? #include float a; double b;

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

Explanation:

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


Next Question→

More Questions from Input / Output

Discussion & Comments

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