11. What occurs when a result has nowhere near the number of significant digits indicated by its type.
12. The function strsp() is the complement of strcspn().
13. NULL is the macro defined in the header string. h.
14. The strpbrk() function is used to return a pointer to the character, or a null pointer if no character from s2 occurs in s1.
15. 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);
const char str1[]="ABCDEF1234567";
const char str2[] = "269";
len = strcspn(str1, str2);
printf("First matching character is at %d\n", len + 1);
16. 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");
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");
17. The . . . . . . . . function returns a pointer to the first character of a token.
18. The mem functions are meant for . . . . . . . .
19. What will the given C code do?
int memcmp(const void *str1, const void *str2, size_t n)
int memcmp(const void *str1, const void *str2, size_t n)
20. Which code from the given option return pointer to last occurrence of c in ch or NULL if not present?
Read More Section(Arrays and Strings)
Each Section contains maximum 100 MCQs question on Arrays and Strings. To get more questions visit other sections.