A

Admin • 833K Points
Coach

Q. What will be the output of the following C code considering the size of a short int is 2, char is 1 and int is 4 bytes?

Code:
#include <stdio.h>
int main()
{
short int i = 20;
char c = 97;
printf("%d, %d, %d
", sizeof(i), sizeof(c), sizeof(c + i));
return 0;
}
  • (A) 2, 1, 2
  • (B) 2, 1, 1
  • (C) 2, 1, 4
  • (D) 2, 2, 8
  • Correct Answer - Option(C)
  • Views: 16
  • Filed under category C Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.