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?
int main() {
    int a = 10, b = 20;
    int c = a * b;
    printf("%d", c);
    return 0;
}
A30
B200
C1020
DCompilation error
Step-by-Step Solution
Solution:
  1. Step 1: Calculate the multiplication of variables

    a is 10, b is 20, so c = 10 * 20 = 200.
  2. Step 2: Understand printf output

    printf prints the value of c, which is 200.
  3. Final Answer:

    200 -> Option B
  4. Quick Check:

    Multiplication result printed correctly = 200 [OK]
Quick Trick: Multiply variables before printing for correct output [OK]
Common Mistakes:
  • Adding instead of multiplying
  • Concatenating numbers as strings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes