1. | Which of the following function sets first n characters of a string to a given character? |
Discuss |
Answer: (b).strnset()
|
2. | If the two strings are identical, then strcmp() function returns |
Discuss |
Answer: (c).0
|
3. | How will you print \n on the screen? |
Discuss |
Answer: (d).printf("\\n");
|
4. | The library function used to find the last occurrence of a character in a string is |
Discuss |
Answer: (c).strrchr()
|
5. | Which of the following function is used to find the first occurrence of a given string in another string? |
Discuss |
Answer: (c).strstr()
|
6. | Which of the following function is more appropriate for reading in a multi-word string? |
Discuss |
Answer: (c).gets();
|
7. | Strcat function adds null character |
Discuss |
Answer: (b).Always
|
8. | The return-type used in String operations are |
Discuss |
Answer: (d).void, int and (char *) only
|
9. | String operation such as strcat(s, t), strcmp(s, t), strcpy(s, t) and strlen(s) heavily rely upon. |
Discuss |
Answer: (a).Presence of NULL character
|
10. | Which pre-defined function returns a pointer to the last occurence of a character in a string? |
Discuss |
Answer: (b).strrchr(s, c);
|