Home » C Programming » Data Types » Question
  1. 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;
    }
    1. 0
    2. 0.0
    3. 8.0
    4. 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.



Your comments will be displayed only after manual approval.