C & C++ Programming Multiple Choice Questions - Set 5

1.       ................ function allows creating very efficient code.
(A) Friend          (B) Member
(C) Inline           (D) Void
Answer: C
2.       ............... is initialized when an object is created.
(A) Constructor                        (B) Destructor
(C) Array                        (D) Pointer
Answer: A
3.       Which one of the following is correct assignment of the variable min to zero?
(A) min = = 0;                (B) min =+ 0
(C) min = 0;                   (D) min ++ 0
Answer: C
4.       To what device is cin linked by default?
(A) printer          (B) keyboard
(C) CPU                        (D) mouse
Answer: B
5.       .............. is the output operator.
(A) >>     (B) <
(C) >       (D) <<
Answer: D

6.       Which one of the following is invalid variable name?
(A) 1count         (B) count
(C) counta         (D) count_a
Answer: A
7.       A/An ............. integer can hold both positive and negative values.
(A) unsigned    (B) positive
(C) negative      (D) signed
Answer: D
8.       The primary difference between float and double is in the ............. of the value they hold.
(A) address       (B) magnitude
(C) sign             (D) decimal point
Answer: B
9.       The ............... type specifies a valueless expression.
(A) int     (B) float
(C) bool (D) void
Answer: D
10.    ............ is the escape sequence that causes a backspace.
(A) \b      (B) \s
(C) \bs    (D) \ba
Answer: A


Post a Comment

0 Comments