C Programming Questions and Answers – Character Class Testing & Conversions – 2

This set of C Multiple Choice Questions & Answers (MCQs) focuses on “Character Class Testing & Conversions – 2”.

Pre-requisite for this C MCQ set: Advanced C Programming Video Tutorial.

1. Which is true about isaplpha(c), where c is an int that can be represented as an unsigned?

char or EOF.isalpha(c) returns

a) Non-zero if c is alphabetic
b) 0 if c is not alphabetic
c) Both Non-zero if c is alphabetic & 0 if c is not alphabetic
d) None of the mentioned
View Answer

Answer: c
Explanation: None.
advertisement
advertisement

2. Which is true about isupper(c), where c is an int that can be represented as an unsigned?

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
char or EOF.isupper(c) returns

a) Non-zero if c is upper case
b) 0 if c is not upper case
c) Nothing
d) Both Non-zero if c is upper case & 0 if c is not upper case
View Answer

Answer: d
Explanation: None.
advertisement

3. Which is true about isalnum(c), where c is an int that can be represented as an unsigned?

 char or EOF.isalnum(c) returns

a) Non-zero if isalpha(c) or isdigit(c)
b) 0 if not isalpha(c) or not isdigit(c)
c) Both Non-zero if isalpha(c) or isdigit(c) & 0 if not isalpha(c) or not isdigit(c)
d) None of the mentioned
View Answer

Answer: c
Explanation: None.
advertisement

4. What will be the output of the following C code?

  1.     #include <stdio.h>
  2.     #include <ctype.h>
  3.     int main()
  4.     {
  5.         char c = 't';
  6.         printf("%d\n", isspace(c));
  7.     }

a) Non-zero number
b) Nothing
c) Error
d) t
View Answer

Answer: a
Explanation: None.

5. What will be the output of the following C code?

  1.     #include <stdio.h>
  2.     #include <ctype.h>
  3.     int main()
  4.     {
  5.         char c = 't';
  6.         printf("is :%c\n", tolower('A'));
  7.     }

a) A
b) a
c) Non-zero number
d) Zero
View Answer

Answer: b
Explanation: None.

6. Which types of input are accepted in toupper(c)?
a) char
b) char *
c) float
d) Both char and char *
View Answer

Answer: a
Explanation: None.

7. What is the difference in the ASCII value of capital and non-capital of the same letter is?
a) 1
b) 16
c) 32
d) Depends with compiler
View Answer

Answer: c
Explanation: None.

Sanfoundry Global Education & Learning Series – C Programming Language.

To practice all areas of C language, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.