Bird
0
0

What will be the output of this C code?

medium📝 Predict Output Q5 of 15
C - Variables and Data Types
What will be the output of this C code?
char c = 'A';
printf("%d", c);
AA
B65
CError
D0
Step-by-Step Solution
Solution:
  1. Step 1: Understand char to int conversion in printf

    Using %d with a char prints its ASCII integer value.
  2. Step 2: Find ASCII value of 'A'

    The ASCII code for 'A' is 65.
  3. Final Answer:

    65 -> Option B
  4. Quick Check:

    char printed as int = ASCII code 65 [OK]
Quick Trick: printf %d with char prints ASCII number [OK]
Common Mistakes:
  • Expecting character output
  • Using wrong format specifier
  • Thinking code errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes