Vidyalelo
C Programming · Q81

Arrays and Strings

Programming · C Programming · question 81

Q81

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 ", mat);

A.
The substring is:world
Answer
B.
The substring is:Hello
C.
The substring is:Helloworld
D.
error in the code

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board