Placement papers on C++ - Set 1

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 Answer

ANSWER: 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 Answer

ANSWER: Pass-by-value




3. 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 Answer

ANSWER: 104




4. 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 Answer

ANSWER: a null character




5. 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 Answer

ANSWER: 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 Answer

ANSWER: 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 Answer

ANSWER: (double) amount




8. 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 Answer

ANSWER: cout << * < P;




9. The keyword used to transfer control from a function back to the calling function is

switch
goto
go back
return
View Answer / Hide Answer

ANSWER: return




10. Which of the following can not be used as identifiers?

Letters
Digits
Underscores
Spaces
View Answer / Hide Answer

ANSWER: Spaces



Post your comment

    Discussion

  • RE: Placement papers on C++ - Set 1 -ecik (02/22/16)
  • This is a prime example of "very poor C++ questions". In fact, it's not even C++, whoever came up with these had little to do with C++.
  • RE: Placement papers on C++ - Set 1 -salomi jagdhane (05/29/15)
  • good

You may like