Question
#include<stdio.h>
int main()
{
float a=3.15529;
printf("%2.1f\n", a);
return 0;
}
What will be the output of the program ?
#include<stdio.h>
int main()
{
float a=3.15529;
printf("%2.1f\n", a);
return 0;
}
Answer: Option C
Was this answer helpful ?
float a=3.15529; The variable a is declared as an float data type and initialized to value 3.15529;
printf("%2.1fn", a); The precision specifier tells .1f tells the printf function to place only one number
after the .(dot).
Hence the output is 3.2
Was this answer helpful ?
More Questions on This Topic :
Question 5.
Out of fgets() and gets() which function i....
Submit Solution