What will be the output of the following C code?
const char str1[10]="Helloworld";
const char str2[10] = "world";
char *mat;
mat = strstr(str1, str2);
printf("The substring is:%s\n", mat);
const char str1[10]="Helloworld";
const char str2[10] = "world";
char *mat;
mat = strstr(str1, str2);
printf("The substring is:%s\n", mat);
A. The substring is:world
B. The substring is:Hello
C. The substring is:Helloworld
D. error in the code
Answer: Option A
Related Questions on Arrays and Strings
Join The Discussion