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);A. The substring is:world
B. The substring is:Hello
C. The substring is:Helloworld
D. error in the code
Select an option to see the answer and solution.
What will be the output of the following C code?
char ch[ ] = "0xC";
if(isxdigit(ch[ ]))
printf("ch = %s is hexadecimal character \n",ch);
else
printf("ch = %s is not hexadecimal character \n",ch);A. ch = 0xC is hexadecimal character
B. ch = 0xC is not hexadecimal character
C. compile error
D. run-time error
Select an option to see the answer and solution.
What will strcmp() function do?
A. compares the first n characters of the object
B. compares the string
C. undefined function
D. copies the string
Select an option to see the answer and solution.
The C library function . . . . . . . . breaks string s1 into a series of tokens using the delimiter s2.
A. char *strtok(char *s1,const char *s2);
B. char *strtok(char *s2,const char *s1);
C. char *strstr(char *s1,const char *s2);
D. char *strstr(char *s2,const char *s1);
Select an option to see the answer and solution.
What is the function of void *memset(s, c, n)?
A. places character s into first n characters of c, return c
B. places character c into first n characters of s, return s
C. places character s into first n characters of c, return s
D. places character c into first n character of s, return c
Select an option to see the answer and solution.
Which among the given options compares atmost n characters of string ch to string s?
A. int strncmp(ch, s, n)
B. int strcmp(ch, s)
C. int strncmp(s, ch, n)
D. int strcmp(s, ch)
Select an option to see the answer and solution.
Is there any function declared as strstr()?
Select an option to see the answer and solution.
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 );Select an option to see the answer and solution.
fgetc, getc, getchar are all declared in . . . . . . . .
A. stdio. h
B. ctype. h
C. assert. h
D. stdarg. h
Select an option to see the answer and solution.
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>A. store c throughout unsigned char s[n]
B. store c throughout signed char s[n]
C. find first occurrence of c in s[n]
D. find last occurrence of c in s[n]
Select an option to see the answer and solution.
What will be the output of the following C code?
int ch= ' ';
if(isgraph(ch))
printf("ch = %c can be printed \n",ch);
else
printf("ch=%c cannot be printed \n",ch);A. ch = ' ' can be printed
B. ch = ' ' cannot be printed
C. compile error
D. run-time error
Select an option to see the answer and solution.
The C library function checks whether the passed character is printable.
A. isgraph()
B. isalpha()
C. isprint()
D. ispunct()
Select an option to see the answer and solution.
What will be the output of the following C code?
int ch = '\t';
if(isprint(ch))
printf("ch = |%c| printable \n", ch);
else
printf("ch= |%c| not printable \n",ch);A. ch = |\t| printable
B. ch = |\t| not printable
C. ch = | | printable
D. ch = | | not printable
Select an option to see the answer and solution.
What will be the output of the following C code?
const char pla[] = "string1";
const char src[] = "string2";
printf("Before memmove place= %s, src = %s\n", pla, src);
memmove(pla, src, 7);
printf("After memmove place = %s, src = %s\n", pla, src);A. Before memmove place= string1, src = string2 After memmove place = string2, src = string2
B. Before memmove place = string2, src = string2 After memmove place= string1, src = string2
C. Before memmove place = string2, src = string1 After memmove place= string2, src =string2
D. Before memmove place= string1, src = string2 After memmove place=string1, src = string1
Select an option to see the answer and solution.
Which of the following is the variable type defined in header string. h?
A. sizet
B. size
C. size_t
D. size-t
Select an option to see the answer and solution.
What will be the output of the following C code?
const char str1[] = "abcdef";
const char str2[] = "fgha";
char *mat;
mat= strpbrk(str1, str2);
if(mat)
printf("First matching character: %c\n", *mat);
else
printf("Character not found");Select an option to see the answer and solution.
Which among the given options is the right explanation for the statement size_t strcspn(c, s)?
A. return length of prefix of s consisting of characters not in c
B. return length of prefix of s consisting of characters present in c
C. return length of prefix of c consisting of characters not in s
D. return length of prefix of c consisting of characters present in s
Select an option to see the answer and solution.
The standard white-space characters are the following: space (' '), form feed (' \ f '),
newline (' \n') , horizontal tab (' \tr), and vertlcal tab (' \v') can be tested with function.
A. ispunct()
B. isalpha()
C. isgraph()
D. isspace()
Select an option to see the answer and solution.
. . . . . . . . occurs when a result is too large in magnitude to represent errors as a floating-point value of the required type.
A. underflow
B. significance loss
C. domain
D. overflow
Select an option to see the answer and solution.
. . . . . . . . tells the compiler that this data is de?ned somewhere and will be connected with the linker.
A. errno
B. extern
C. variable
D. yvals
Select an option to see the answer and solution.