Question
#include<stdio.h>
int main()
{
float fval=7.29;
printf("%d\n", (int)fval);
return 0;
}
What will be the output of the program?
#include<stdio.h>
int main()
{
float fval=7.29;
printf("%d\n", (int)fval);
return 0;
}
Answer: Option D
Was this answer helpful ?
printf("%d`setminus`n", (int)fval); It prints '7'. because, we typecast the (int)fval in to integer.
It converts the float value to the nearest integer value.
Was this answer helpful ?
More Questions on This Topic :
Question 7.
The binary equivalent of 5.375 is
....
Submit Solution