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 ( )
    {
    printf ("%d %d %d\n" , sizeof(2.19f), sizeof(2.19), sizeof (2.19l));
    return 0 ;
    }
    1. 4 4 4
    2. 4 8 8
    3. 4 8 10
    4. 4 8 12
Correct Option: B

sizeof(2.19f) here '2.19f' specifies the float data type. Hence size of float is 4 bytes.

sizeof(2.19) here '2.19' specifies the double data type. Hence size of float is 8 bytes.

sizeof(2.19l) here '2.19l' specifies the long double data type. Hence size of float is 10 bytes.



Your comments will be displayed only after manual approval.