Programming in C++
Programming questions in C++ covers questions to test programming skills of students in development languages.
Questions
Which of the following is the process of creating instances from classes?
- Inheritance
- Polymorphism
- Instantiation
- Data abstraction
- Platform independent
In C++, 'Car' is considered as which of the following?
- Object
- Attribute
- Class
- Structure
- String
Which of the following types of inheritance permits more than one super class and inherits features from all ancestors?
- Single inheritance
- Multiple inheritance
- Multilevel inheritance
- Hierarchical inheritance
- Polymorphism
Which of the following is not a visibility mode in C++?
- Private
- Protected
- Public
- Friend
- Both private and public
Which of the following operators in C++ cannot be overloaded?
- Arithmetic operator
- Relational operator
- Conditional operator
- Comparison operator
- Addition operator
Which of the following functions in C++ is used for performing short term calculation?
- Memory allocation function
- Inline function
- Member function
- Default function
- Friend function
What will be the output of the following C++ statement?
cout<<4.5%3;
- 0
- 1
- 1.5
- 0.5
- 5
Which of the following is not a header file in C++?
- iostream.h
- conio.h
- stream.h
- stdlib.h
- ctype.h
Which of the following statements is the correct output statement in C++?
- cin>>"India";
- cin<<"India";
- cout<<"India";
- cout>>"India";
- cout<<India;
Which of the following is not an advantage of using function in C++ program?
- It debuggs a program easily.
- It consumes less disk space.
- Recursive calls to function is possible.
- Testing a program becomes easier.
- Complexity of a program is reduced.
Which of the following is a pointer to the current object, which is passed implicitly to an overloaded function in C++?
- This
- New
- Delete
- Private
- Scope
In C++, if a class is derived from another derived class, then what is it known as?
- Multiple inheritance
- Multilevel inheritance
- Single inheritance
- Hierarchical inheritance
- Protected inheritance
A class named employee must have a constructor whose name is ___________.
- employer
- ~employee
- constructor
- employee
- any legal C++ name
Which of the following statements in C++ creates an infinite loop?
- while(; ;)
- for(; ;)
- if(; ;)
- switch(; ;)
- do(; ;)
Which of the following statement is true about function overloading?
- Calling a function from another function
- Calling a same function with different form
- Calling a function from itself
- Calling a same function in same form every time
- There is no such term in C++