Arrays And Strings - Study Mode
[#91] 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)
Correct Answer
(A) The substring is:world
[#92] What will be the output of the following C code? char ch[ ] = "0xC"
if(isxdigit(ch[ ]))
printf("ch = %s is hexadecimal character
",ch)
else
printf("ch = %s is not hexadecimal character
",ch)
Correct Answer
(A) ch = 0xC is hexadecimal character
[#93] The C library function . . . . . . . . breaks string s1 into a series of tokens using the delimiter s2.
Correct Answer
(A) char *strtok(char *s1,const char *s2)
[#94] 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
", len )
Correct Answer
(B) 5
[#95] What will be the output of the following C code? void *memset(void *c, int c, size-t n)
unsigned char ch = c
unsigned char *su
for (su = s
0 < n
++su, --n)
<br>
*su = ch
<br>
Correct Answer
(A) store c throughout unsigned char s[n]