C
Programming and Technical
Programming
Program
To scan a and b given below, which of the following scanf() statement will you use?
#include
float a;
double b;
Options
1) scanf("%f %f", &a, &b);
2) scanf("%Lf %Lf", &a, &b);
3) scanf("%f %Lf", &a, &b);
4) scanf("%f %lf", &a, &b);
Read Solution (Total 12)
-
- option 4 will be thw answer
- 7 years agoHelpfull: Yes(1) No(0)
- Answer: Option D
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); - 7 years agoHelpfull: Yes(1) No(0)
- A function called for many times is called recursion
- 9 years agoHelpfull: Yes(0) No(2)
- a function call itself and itself many time depending on condition is called recursion
- 9 years agoHelpfull: Yes(0) No(3)
- scanf is used for get the values. That is float format string : %f and double format string is : %lf.
- 7 years agoHelpfull: Yes(0) No(0)
- since float is represented as f the scanf() statement would be %f
since double can also be represented as long float Lf() scanf statement would be %Lf
so the answer would be 3) scanf("%f %Lf",&a,&b); - 6 years agoHelpfull: Yes(0) No(0)
- For float %f is used and for double %lf is used
- 4 years agoHelpfull: Yes(0) No(0)
- option4
because to scan float %f will be used and to scan double %lf will used - 4 years agoHelpfull: Yes(0) No(0)
- option 4
in float %f ,int %d,double %lf are used as format specifier - 4 years agoHelpfull: Yes(0) No(0)
- 3) FLOAT=f
double=Lf - 4 years agoHelpfull: Yes(0) No(1)
- float=%f
double =%LF - 4 years agoHelpfull: Yes(0) No(0)
- Scanf("%f%lf",&a,&b);
- 4 years agoHelpfull: Yes(0) No(0)
C Other Question