Strings - General Questions Online Exam Quiz
Strings - General Questions GK Quiz. Question and Answers related to Strings - General Questions. MCQ (Multiple Choice Questions with answers about Strings - General Questions
Which of the following function sets first n characters of a string to a given character?
Options
A : strinit()
B : strnset()
C : strset()
D : strcset()
If the two strings are identical, then strcmp() function returns
Options
A : -1
B : 1
C : 0
D : Yes
How will you print on the screen?
Options
A : printf(" ");
B : echo "\n";
C : printf(' ');
D : printf("\n");
The library function used to find the last occurrence of a character in a string is
Options
A : strnstr()
B : laststr()
C : strrchr()
D : strstr()
Which of the following function is used to find the first occurrence of a given string in another string?
Options
A : strchr()
B : strrchr()
C : strstr()
D : strnset()
Which of the following function is more appropriate for reading in a multi-word string?
Options
A : printf();
B : scanf();
C : gets();
D : puts();
Which of the following function is correct that finds the length of a string?
Options
A : int xstrlen( char *s) { int length= 0 ; while (*s!= '