Which of the following function is used to find the first occurrence of a given

Home | Discussion Forum
Taiyari24Hour

Which of the following function is used to find the first occurrence of a given string in another string?



View More Related Question

2) 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]);
}

3) What will be the output of the following program?

void main()
{
char str1[] = "abcd";
char str2[] = "abcd";
if(str1==str2)
printf("Equal");
else
printf("Unequal");
}

4) What will be the output of the program ?

 #include<stdio.h>
int main()
{
int i;
char a[] = "\0";
if(printf("%s", a))
printf("empty string\n");
else
printf("not empty string \n");
return 0;
}

5) What is the output of this C code?

#include <stdio.h>
int main()
{
char *str = "hello, world";
char *str1 = "hello, world";
if (strcmp(str, str1))
printf("equal");
else
printf("unequal");
}

UP Gk Online Test

taiyari24hour.com

Study 2 Online Says....
Kindly log in or signup.