C Programming – String Operations

C Programming - Character Class Testing & Conversions

Question 1
Which of the following library function is not case-sensitive?
A
toupper()
B
tolower()
C
isdigit()
D
All of the mentioned
Question 2
 The following expression can be substituted for.     if (isalpha(c) && isdigit(c))
A
if (isalnum(c))
B
if (isalphanum(c))
C
if (isalphanumeric(c))
D
None of the mentioned
Question 3
 Which of the following will return a non-zero value when checked with isspace(c)?
A
blank
B
newline
C
return
D
All of the mentioned
Question 4
What is the output of this C code?
    #include 
    #include 
    int main()
    {
    char i = 9;
    if (isdigit(i))
    printf("digit\n");
    else
    printf("not digit\n");
    return 0;
    }
A
digit
B
not digit
C
Depends on the compiler
D
None of the mentioned
Question 5
What is the output of this C code?
    #include 
    #include 
    int main()
    {
    int i = 9;
    if (isdigit(i))
    printf("digit\n");
    else
    printf("not digit\n");
    return 0;
    }
A
digit
B
not digit
C
Depends on the compiler
D
None of the mentioned
Question 6
What is the output of this C code?
    #include 
    int main()
    {
    char i = '9';
    if (isdigit(i))
    printf("digit\n");
    else
    printf("not digit\n");
    return 0;
    }
A
digit
B
not digit
C
Depends on the compiler
D
None of the mentioned
Question 7
What is the output of this C code?
    #include 
    #include 
    int main()
    {
    if (isspace('n'))
    printf("space\n");
    else
    printf("not space\n");
    return 0;
    }
A
Compile time error
B
space
C
not space
D
None of the mentioned
Question 8
What is the output of this C code?
    #include 
    #include 
    int main()
    {
    int i = 0;
    if (isspace(i))
    printf("space\n");
    else
    printf("not space\n");
    return 0;
    }
A
Compile time error
B
space
C
not space
D
None of the mentioned
Question 9
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 a & b
D
None of the mentioned
Question 10
 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 a & b
D
None of the mentioned
Question 11
What is the output of this C code?
    #include 
    #include 
    int main()
    {
    char c = 't';
    printf("%d\n", isspace(c));
    }
A
Non-zero number
B
Nothing
C
Error
D
t
Question 12
What is the output of this C code?
    #include 
    #include 
    int main()
    {
    char c = 't';
    printf("is :%c\n", tolower('A'));
    }
A
A
B
a
C
Non-zero number
D
Zero
Question 13
 Which types of input are accepted in toupper(c)?
A
char
B
char *
C
float
D
Both (a) and (b)
Question 14
 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


Check Your Answers:

  1. C
  2. D
  3. D
  4. B
  5. B
  6. A
  7. B
  8. C
  9. C
10. C
11. A
12. B
13. A
14. C


SHARE

Unknown

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment