CS201 Quiz Introduction to Programming C++
Question No: 1 ( Marks: 1 ) - Please choose one
The return type of operator function must always be void.► True
► False
Question No: 2 ( Marks: 1 ) - Please choose one
What does (*this) represents?
► The current function of the class
► The current pointer of the class
► The current object of the class
► A value of the data member
Question No: 3 ( Marks: 1 ) - Please choose one
The statement cin.get (); is used to,► Read a string from keyboard
► Read a character from keyboard
► Read a string from file
► Read a character from file
Question No: 4 ( Marks: 1 ) - Please choose one
When we do dynamic memory allocation in the constructor of a class, then it is necessary to provide a destructor.► True
► False
Question No: 5 ( Marks: 1 ) - Please choose one
Overloaded new operator function takes parameter of type size_t and returns► void (nothing)
► void pointer
► object pointer
► int pointer
Question No: 6 ( Marks: 1 ) - Please choose one
What will be the correct syntax to assign an array named arr of 5 elements to a pointer ptr?► *ptr = arr ;
► ptr = arr ;
► *ptr = arr[5] ;
► ptr = arr[5] ;
Question No: 7 ( Marks: 1 ) - Please choose one
C++ is a case-sensitive language► True
► False
Question No: 9 ( Marks: 1 ) - Please choose one
To include code from the library in the program, such as iostream, a directive would be called up using this command.► #include “iostream.h”
► include
► include
► #include
Question No: 10 ( Marks: 1 ) - Please choose one
A template function must have only generic data types.► True
► False