Arrays and Strings MCQs
Practice free Arrays and Strings multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 133 questions — no login required.
Question 109medium
Which header declares several functions useful for testing and mapping characters?
Question 110hard
What will be the output of the following C code?
int i = 0;
char c;
char str[ ] = "Little Star";
while(str[i])
{
putchar (toupper(str[i]));
i++;
}Question 111medium
What occurs when a result has nowhere near the number of significant digits indicated by its type.
Advertisement
Question 112medium
The function strsp() is the complement of strcspn().
Question 113easy
NULL is the macro defined in the header string. h.
Question 114medium
The strpbrk() function is used to return a pointer to the character, or a null pointer if no character from s2 occurs in s1.
Advertisement
Question 115hard
What will be the output of the following C code?
const char str1[]="ABCDEF1234567";
const char str2[] = "269";
len = strcspn(str1, str2);
printf("First matching character is at %d\n", len + 1);Question 116hard
What will be the output of the following C code?
char str1[15];
char str2[15];
int mat;
strcpy(str1, "abcdef");
strcpy(str2, "ABCDEF");
mat= strncmp(str1, str2, 4);
if(mat< 0)
printf("str1 is not greater than str2");
else if(mat> 0)
printf("str2 is is not greater than str1");
else
printf("both are equal");Question 117medium
The . . . . . . . . function returns a pointer to the first character of a token.