Placement papers on C++ - Set 1
1. A constructor
Constructs new data type
Enables the initialization of an object as it is created
Obtain memory for a new variable
None of the above
View Answer / Hide AnswerANSWER: Enables the initialization of an object as it is created
2. When a copy of an entire object is passed to a function, then it is referred to as
Pass-by-reference
Pass-by-pointer
Pass-by-value
None of the above
View Answer / Hide Answer3. Consider the statements a = 13 ; c = a<< 3 ; (a and c are integers). The result assigned to the integer c is
104
114
140
14
View Answer / Hide Answer4. What does C++ append to the end of a string literal constant?
a space
a number sign (#)
an asterisk (*)
a null character
View Answer / Hide Answer5. The statement int num[2][3]={ {1,2}, {3,4}, {5, 6} };
assigns a value 2 to num[1][2]
assigns a value 4 to num[1][2]
gives an error message
assigns a value 3 to num[1][2]
View Answer / Hide AnswerANSWER: gives an error message
6. The statement fwrite ( (char*)&objl, sizeof(objl) );
writes the member functions of objl to fl
writes the data in objl to fl
writes the member functions and me data of obj 1 to fl
writes the address of objl to fl
View Answer / Hide AnswerANSWER: writes the data in objl to fl
7. Which of the following type casts will convert an Integer variable named amount to a Double type?
(double) amount
(int to double) amount
int to double(amount)
int (amount) to double
View Answer / Hide Answer8. You have assigned the address of Value to the pointer P, Which statement will display the value stored in Value?
cout << P;
cout << *Value;
cout << &P;
cout << * < P;
View Answer / Hide Answer9. The keyword used to transfer control from a function back to the calling function is
switch
goto
go back
return
View Answer / Hide Answer10. Which of the following can not be used as identifiers?
Letters
Digits
Underscores
Spaces
View Answer / Hide Answer