M

Mr. Dubey • 100.28K 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

Explanation by: Mr. Dubey
'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.


Question analytics