Object Oriented Programming With C Plus Plus - Multiple Choice Questions -011

101. Variables that are declared inside a function are called as ______.
A. local.
B. global.
C. scope.
D. external.
ANSWER: A
102. Most of the statement in C++ program should end with ______.
A. a full stop (.).
B. `a comma (,).
C. a semicolon (;).
D. a colon (:).
ANSWER: C
103. __________ is a newline character in c++.
A. end
B. endl
C. \t
D. ;
ANSWER: B
104. If and the switch statements are called as _____ statements.
A. iteration.
B. jump.
C. selection.
D. conditional.
ANSWER: C
105. The switch expression must be of type _______ or _______.
A. char, float.
B. float, int.
C. int, char.
D. char, float.
ANSWER: C
106. Find out the error in following block of code. if (x=100) cout<<"x is 100";
A. 100 should be enclosed in quotations.
B. There is no semicolon at the end of first line.
C. Equals to operator mistake.
D. Variable x should not be inside quotation.
ANSWER: C
107. Looping in a program means _____.
A. jumping to the specified branch of program.
B. repeat the specified lines of code.
C. execute only once.
D. jump to random location of the program.
ANSWER: B
108. The last index of strings contains the _____ null-terminated character.
A. \1.
B. \t
C. \0
D. \n
ANSWER: C
109. If the type specifier of parameters of a function is followed by an ampersand (&), that function call is _______.
A. pass by value.
B. pass by reference.
C. array of structures.
D. array of structures. pointers.
ANSWER: B
110. getline() and write() are _________ oriented functions.
A. line.
B. character.
C. data.
D. integer.
ANSWER: A

No comments:

Post a Comment