Q. What does the following code do?

Code:
#include <stdio.h>
int main() {
    char c = 'A';
    printf("%d", c);
    return 0;
}
  • (A) Prints A
  • (B) Prints 65
  • (C) Prints error
  • (D) Prints nothing
πŸ’¬ Discuss
βœ… Correct Answer: (B) Prints 65
Explanation: char 'A' has ASCII value 65, so printing it as int gives 65.
Explanation by: Mr. Dubey
char 'A' has ASCII value 65, so printing it as int gives 65.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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