Bird
0
0

What will be the output of this code?

medium📝 Predict Output Q5 of 15
C - Operators and Expressions
What will be the output of this code?
int x = 10;
int y = 3;
int z = x % y;
printf("%d", z);
AError
B3
C0
D1
Step-by-Step Solution
Solution:
  1. Step 1: Understand modulus operator

    The % operator gives the remainder of division.
  2. Step 2: Calculate remainder of 10 divided by 3

    10 divided by 3 is 3 with remainder 1.
  3. Final Answer:

    1 -> Option D
  4. Quick Check:

    Modulus output = 1 [OK]
Quick Trick: Use % to get remainder after division [OK]
Common Mistakes:
  • Confusing % with division
  • Expecting quotient instead of remainder
  • Syntax errors in modulus usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes