A

Admin • 833K Points
Coach

Q. What is the output of this code?

Code:
#include <stdio.h>
int main() {
printf("%d", sizeof('A'));
return 0;
}
  • (A) 1
  • (B) 2
  • (C) 4
  • (D) Depends on compiler
  • Correct Answer - Option(C)
  • Views: 15
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

'A' is treated as int in C, hence size is 4 bytes.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.