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

1.       The specification of the number 100 as long int is .............
(A) L100                        (B) 100
(C) 100L                        (D) 100I
Answer: C
2.       Which of the following is not true in type conversions?
(A) The value of RHS is assignment is converted to the type of LHS.
(B) When converting from a floating point type to an integer the fractional part will be lost.
(C) When constants and variables of different types are mixed in an expression, they are converted to the same type.
(D) The conversion from a char to a double is invalid.
Answer: D
3.       The value that follows the keyword CASE may only be
(A) constants    (B) variable
(C) number       (D) semicolon
Answer: A
4.       The statement which is used to terminate the control from the loop is
(A) break           (B) continue
(C) goto                         (D) exit
Answer: A
5.       The machine registers are sometimes called
(A) local variables        (B) global variables
(C) accumulators         (D) static variables
Answer: A

6.       How many times the following loop be executed
{
ch = ‘b’;
while(ch >= ‘a’ && ch <= ‘z’)
ch++; }
(A) 0       (B) 25
(C) 26     (D) 1
Answer: B
7.       Which of the following is FALSE in C
(A) Keywords can be used as variable names
(B) Variable names can contain a digit
(C) Variable names do not contain a blank space
(D) Capital letters can be used in variable names
Answer: A
8.       ................... is automatically created when constructors are used.
(A) Objects        (B) Destructors
(C) Arrays          (D) Reference
Answer: B
9.       ................ members are public by default and fully compatible.
(A) Protected    (B) Private
(C) Enum          (D) Union
Answer: D
10.    A ................ defines a class type.
(A) structure                  (B) union
(C) enumeration          (D) type def
Answer: A


Post a Comment

0 Comments