Bird
0
0

Which of the following type modifiers in C is used to store only non-negative values?

easy📝 Conceptual Q11 of 15
C - Variables and Data Types
Which of the following type modifiers in C is used to store only non-negative values?
Ashort
Bsigned
Clong
Dunsigned
Step-by-Step Solution
Solution:
  1. Step 1: Understand the meaning of 'unsigned'

    The 'unsigned' modifier means the variable can only hold zero or positive values, no negatives.
  2. Step 2: Compare with other modifiers

    'signed' allows negative and positive values, 'short' and 'long' change size but not sign.
  3. Final Answer:

    unsigned -> Option D
  4. Quick Check:

    unsigned = non-negative only [OK]
Quick Trick: Unsigned means no negative numbers allowed [OK]
Common Mistakes:
  • Confusing 'signed' with 'unsigned'
  • Thinking 'short' affects sign
  • Assuming 'long' means unsigned

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes