Multiple choice

Find the output of the following C code. void main() { char Rch; int Rn; float Rr; printf(%d %d %d, sizeof(Rch),sizeof(Rn),sizeof(Rr)); }

  1. 1 1 1

  2. 1 2 4

  3. 1 2 2

  4. 2 4 4

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

Rch is a character variable and it occupies 1 byte. Rn is an integer variable and it occupies 2 bytes. Rr is a float variable and it occupies 4 bytes. Hence, the output will be 1 2 4.