C Strings Questions and Answers
Practice ModeShowing 10 of 26 questions
Q21
What will be the output ?
char st [ ] = "India";
char *p;
strcpy (p, st);
printf("%s and %s are same", st, p);
Answer: Option D
Q22
*1* char st [ ] = "Mandaveli";
*2* char *p;
*3* strcpy (p, st);
*4* printf ("%s and %s are same", st, p);
If the code does result in error, what is the solution to be taken?
Answer: Option D
Q23
What will strcmp return, if both the strings are equal ?
Answer: Option B
Q24
Whioch of the following function is used to check the presence of a substring?
Answer: Option A
Q25
What does atoi ( ) function do ?
Answer: Option A
Q26
What does strlen ( ) return for the following character array ?
char str [ ] = "MIT\OIT";
Answer: Option C