Question 12
Back to Exercise
What does isdigit('7') return?
- A 1 exactly
- B A non-zero value (not necessarily 1) Correct
- C The digit value 7
- D The character '7'
Correct Answer: Option B
ctype tests return zero or non-zero; some libraries return bit masks such as 2048. Use them in conditions, not in comparisons with 1. To get the value use c - '0'.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!