Programming in C++

Programming questions in C++ covers questions to test programming skills of students in development languages.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is the process of creating instances from classes?

  1. Inheritance
  2. Polymorphism
  3. Instantiation
  4. Data abstraction
  5. Platform independent
Question 2 Multiple Choice (Single Answer)

In C++, 'Car' is considered as which of the following?

  1. Object
  2. Attribute
  3. Class
  4. Structure
  5. String
Question 3 Multiple Choice (Single Answer)

Which of the following types of inheritance permits more than one super class and inherits features from all ancestors?

  1. Single inheritance
  2. Multiple inheritance
  3. Multilevel inheritance
  4. Hierarchical inheritance
  5. Polymorphism
Question 4 Multiple Choice (Single Answer)

Which of the following is not a visibility mode in C++?

  1. Private
  2. Protected
  3. Public
  4. Friend
  5. Both private and public
Question 5 Multiple Choice (Single Answer)

Which of the following operators in C++ cannot be overloaded?

  1. Arithmetic operator
  2. Relational operator
  3. Conditional operator
  4. Comparison operator
  5. Addition operator
Question 6 Multiple Choice (Single Answer)

Which of the following functions in C++ is used for performing short term calculation?

  1. Memory allocation function
  2. Inline function
  3. Member function
  4. Default function
  5. Friend function
Question 7 Multiple Choice (Single Answer)

What will be the output of the following C++ statement?
cout<<4.5%3;

  1. 0
  2. 1
  3. 1.5
  4. 0.5
  5. 5
Question 8 Multiple Choice (Single Answer)

Which of the following is not a header file in C++?

  1. iostream.h
  2. conio.h
  3. stream.h
  4. stdlib.h
  5. ctype.h
Question 9 Multiple Choice (Single Answer)

Which of the following statements is the correct output statement in C++?

  1. cin>>"India";
  2. cin<<"India";
  3. cout<<"India";
  4. cout>>"India";
  5. cout<<India;
Question 10 Multiple Choice (Single Answer)

Which of the following is not an advantage of using function in C++ program?

  1. It debuggs a program easily.
  2. It consumes less disk space.
  3. Recursive calls to function is possible.
  4. Testing a program becomes easier.
  5. Complexity of a program is reduced.
Question 11 Multiple Choice (Single Answer)

Which of the following is a pointer to the current object, which is passed implicitly to an overloaded function in C++?

  1. This
  2. New
  3. Delete
  4. Private
  5. Scope
Question 12 Multiple Choice (Single Answer)

In C++, if a class is derived from another derived class, then what is it known as?

  1. Multiple inheritance
  2. Multilevel inheritance
  3. Single inheritance
  4. Hierarchical inheritance
  5. Protected inheritance
Question 13 Multiple Choice (Single Answer)

A class named employee must have a constructor whose name is ___________.

  1. employer
  2. ~employee
  3. constructor
  4. employee
  5. any legal C++ name
Question 14 Multiple Choice (Single Answer)

Which of the following statements in C++ creates an infinite loop?

  1. while(; ;)
  2. for(; ;)
  3. if(; ;)
  4. switch(; ;)
  5. do(; ;)
Question 15 Multiple Choice (Single Answer)

Which of the following statement is true about function overloading?

  1. Calling a function from another function
  2. Calling a same function with different form
  3. Calling a function from itself
  4. Calling a same function in same form every time
  5. There is no such term in C++