C Programming - Input / Output - Discussion
|
|
|
|
Read more:"Loneliness is the most terrible poverty."
- Mother Teresa
|
| 8. |
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); |
Answer: Option 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);
|
|
Srianth said:
(Thu, Aug 11, 2011 07:45:10 PM)
|
|
| |
See guys.
Ans:A.
Reason:.
The default real numbers takes data type as"Double".
So %f=default double. Hence ans'''. |
|
|