Multiple choice

void main() { printf("%d"t, sizeof(7.5)); printf("%d"t, sizeof(80000)); printf("%d"t, sizeof('B')); }.

Which of the following is the output of the program?

  1. 8, 2, 2

  2. 4, 4, 2

  3. 8, 4, 2

  4. Compilation error

  5. Runtime error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Sizeof operator is used to provide size of the given variable. Here, sizeof(7.5) provides the size 8 byte because it is a double type. Sizeof(80000) provides the size 4 byte because it is long int type. Sizeof ('B') provides the size 2 byte because it is a character type.