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.

1. Some Streams work with input, and some with output
a. True
b. False
c. May be
d. Can't say
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).True

2. What does C++ append to the end of a string literal constant?
a. a space
b. a number sign (#)
c. an asterisk (*)
d. a null character
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).a null character

3. Which of the following is(are) invalid string constant(s)?
a. '7.15 pm'
b. "i like e"
c. "7.3el2"
d. "1234el2"
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).'7.15 pm'

4. To use either an input or output file, the program must include the _____ header file
a. filestream.h
b. fstream.h
c. instream.h
d. inoutstream.h
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).fstream.h

5. The first element in a string is
a. the name of the string
b. the first character in the string
c. the length of the string
d. the name of the array holding the string
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).the first character in the string

6. You typically initialize a String variable to _____
a. an asterisk
b. a space enclosed in single quotes
c. the number 0
d. a zero-length string
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).a zero-length string

7. The end of string is recognized by
a. the null character
b. the newline character
c. the $ sign
d. the / sign
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).the null character

8. The string HELLO WORLD needs
a. 11 bytes
b. 12 bytes
c. 10 Bytes
d. 8 bytes
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).11 bytes

9. Which of the following stream manipulators advances the cursor to the next line on the computer screen?
a. adin
b. advin
c. edlin
d. endl
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).endl

10. You can use the C++ _____ function to assign a value to a String variable
a. assign
b. copy
c. string
d. strcpy
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).strcpy

Page 1 of 21