C++

C++ Objective Questions And Answers

More interview questions and answers

C++ was invented by a. Donald Drum b. Ken Thompson c. Bjarne Stroustrup

c. Bjarne Stroustrup

Which one is use for standard C++ comment. a. / b. /* */ c. //

c. 

What the use of preprocessor directory(# include) a. Used for console output b. Used for console input c. Used for both console input and output

c. Used for both console input and output 

In C++ operator << is called as a. an insertion operator or put to operator b. an extracton operator or get from operator c. an insertion operator or get from operator

a. an insertion operator or put to operator

In C++ operator >>is called as a. an extraction operator or get from operator b. an insertion operator or put to operator c. an extraction operator or put to operator

a. an extraction operator or get from operator

Who suggest C++ name? a. Bjnare Stroustrup b. Ken Thompson c. Rrick Mascitti

c. Rrick Mascitti

Constructor is called when a. a method is declared b. a class is declared c. a object is declared

c. a object is declared

Who is differ from other? a. C b. C++ c. Java

a. C because C is not Object Oriented Language like C++ and Java.

Function overloading in C++ is a. a group function with the same name b. all have the same number and type of arguments c. functions with same name and same number and type of arguments

a. a group function with the same name

Opertor Overloading is like that a. giving new meaning to existing C++ operators b. making c++ operators works with objects c. both a and b

c. both a and b

Destructor can contain a. Zero arguments b. One arguments c. Two arguments

a. Zero arguments

How constructor differ from destructor a. constructors can be overloaded but destructors can't be overloaded b. constructors can take arguments but destructor can't c. both a and b

c. both a and b

In C++ a function contain in class called as a. a method b. a member function c. a class function

b. a member function

By default fields in a C++ class are a. Public b. Private c. Protected

b. Private

What is output of follwoing int main() { cout << "R4R" << endl; return 0; } 1.Execution time error 2.Syntax error 3.R4R 4.None

2.Syntax error

What is output of following #include int main() { cout << "R4R" << endl; return 0; } 1.Execution time error 2.Syntax error 3.R4R 4.None

3.R4R

What is output of follwoing int main() { int a=000; cout << "R4R:"; cout << a; return 0; } 1.Execution time error 2.Syntax error 3.R4R:0 4.None

3.R4R:0

C++ Objective Questions And Answers