Bird
0
0

Which of the following is the correct syntax to decrement a variable count by 1 using the pre-decrement operator?

easy📝 Syntax Q3 of 15
C - Operators and Expressions
Which of the following is the correct syntax to decrement a variable count by 1 using the pre-decrement operator?
Acount--;
Bcount++;
Ccount -= 1;
D--count;
Step-by-Step Solution
Solution:
  1. Step 1: Identify pre-decrement operator syntax

    The pre-decrement operator is written as --variable; which decreases the variable before use.
  2. Step 2: Match syntax to options

    --count; uses --count; which is the correct pre-decrement syntax.
  3. Final Answer:

    --count; -> Option D
  4. Quick Check:

    Pre-decrement uses -- before variable [OK]
Quick Trick: Pre-decrement uses -- before variable name [OK]
Common Mistakes:
  • Using post-decrement instead of pre-decrement
  • Confusing decrement with increment
  • Using incorrect operator placement

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes