A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

11. Which of the following function compares 2 strings with case-insensitively?
a. strcmp(s, t)
b. strcmpcase(s, t)
c. strcasecmp(s, t)
d. strchr(s, t)
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).strcasecmp(s, t)

12. String concatenation means -
a. Combining two strings.
b. Extracting a substring out of a string.
c. Partitioning the string into two strings.
d. Comparing the two strings to define the larger one.
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).Combining two strings.

13. What is the return value of the following statement if it is placed in C program?

strcmp("ABC", "ABC");
a. 33
b. 1
c. 0
d. Compilation Error
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).0

14. What is the following code segment doing?
void fn( ){
char c;
cin.get(c);
if (c != ‘\n’) {
fn( );
cout.put(c);
}
}
a. The string entered is printed as it is.
b. The string entered is printed in reverse order.
c. It will go in an infinite loop.
d. It will print an empty line.
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).The string entered is printed in reverse order.

15. Pattern matching refers to string____________.
a. Searching
b. Matching problem
c. Both (a) and (b)
d. None of the above
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).Both (a) and (b)

Page 2 of 2