LearnFrenzy
Sign in Take a free test

C Library Functions · Library Functions MCQ · Question 12

What does isdigit() return for true? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links