-
Which of the following is the correct output for the program given below?
#include <stdio.h>
int main ( )
{
float floatvalue = 8.25;
printf ("%d\n " , (int) floatvalue);
return 0;
}
-
- 0
- 0.0
- 8.0
- 8
Correct Option: D
It prints '8'. because, we typecast the (int)floatvalue into integer. It converts the float value to the nearest integer value.