C Language MCQ - English
Which of the following function is used to find the first occurrence of a given
Home | Discussion ForumWhich of the following function is used to find the first occurrence of a given string in another string?
strchr()
strrchr()
strstr()
strnset()
Answer : C
View More Related Question
1) What is the output of this C code?
#include <stdio.h>
int main()
{
char *str = "hello, world\n";
printf("%d", strlen(str));
}
2) Which is more appropriate for reading in multi-word string?
3) If the two strings are identical, then strcmp() function returns
4) What is the output of this C code?
#include <stdio.h>
int main()
{
char str[11] = "hello";
char *str1 = "world";
strcat(str, str1);
printf("%s %d", str, str[10]);
}
5) Which of the following function is used to find the first occurrence of a given string in another string?