A

Admin • 828.03K Points
Coach

Q. What is the output of the following code?

Code:
#include <stdio.h>
int main() {
char ch = 'A' + 2;
printf("%c", ch);
return 0;
}
  • (A) B
  • (B) C
  • (C) D
  • (D) A
  • Correct Answer - Option(B)
  • Views: 9
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin
'A' + 2 is 'C' as it adds 2 to ASCII value of A.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.