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
πŸ’¬ Discuss
βœ… Correct Answer: (B) C
Explanation: 'A' + 2 is 'C' as it adds 2 to ASCII value of A.
Explanation by: Mr. Dubey
'A' + 2 is 'C' as it adds 2 to ASCII value of A.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
78
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
85%
Success Rate