What will be the output of the following C code?
char str1[] = "Helloworld ";
char str2[] = "Hello";
len = strspn(str1, str2);
printf("Length of initial segment matching %d\n", len );
char str1[] = "Helloworld ";
char str2[] = "Hello";
len = strspn(str1, str2);
printf("Length of initial segment matching %d\n", len );
A. 6
B. 5
C. 4
D. no match
Answer: Option B
Related Questions on Arrays and Strings
Join The Discussion