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
Answer
Answer: c [Reason:] None.
2. Which is true about isupper(c), where c is an int that can be represented as an unsigned
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
Answer
Answer: d [Reason:] None.
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
Answer
Answer: c [Reason:] None.
4. What is the output of this C code?
-
#include <stdio.h>
-
#include <ctype.h>
-
int main()
-
{
-
char c = 't';
-
printf("%dn", isspace(c));
-
}
a) Non-zero number
b) Nothing
c) Error
d) t
Answer
Answer: a [Reason:] None.
5. What is the output of this C code?
-
#include <stdio.h>
-
#include <ctype.h>
-
int main()
-
{
-
char c = 't';
-
printf("is :%cn", tolower('A'));
-
}
a) A
b) a
c) Non-zero number
d) Zero
Answer
Answer: b [Reason:] None.
6. Which types of input are accepted in toupper(c)?
a) char
b) char *
c) float
d) Both char and char *
Answer
Answer: a [Reason:] 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
Answer
Answer: c [Reason:] None.