0% found this document useful (0 votes)
60 views3 pages

CPP Question Bank

The document is a question bank for C++ programming, containing various questions categorized into 2, 3, and 4 marks. It covers topics such as operators, constructors, inheritance, polymorphism, exception handling, and file operations. Additionally, it includes programming tasks that require the implementation of specific C++ functionalities.

Uploaded by

iamtahereditz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views3 pages

CPP Question Bank

The document is a question bank for C++ programming, containing various questions categorized into 2, 3, and 4 marks. It covers topics such as operators, constructors, inheritance, polymorphism, exception handling, and file operations. Additionally, it includes programming tasks that require the implementation of specific C++ functionalities.

Uploaded by

iamtahereditz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

PRACTICE MORE QUESTIONS OF TRACE THE OUTPUT FROM QUESTION PAPERS

C++ (CPP) - QUESTION BANK

2 Marks Questions

• What is extraction and insertion operator?

• Explain any two manipulators.

• Define constructor.

• What is inline function?

• What is reference variable? What is its major use?

• What is abstraction and encapsulation?

• What is compile-time polymorphism?

• What is default argument?

• What is the use of scope resolution operator?

• What are the access specifiers used in C++?

• What is destructor?

• What is static polymorphism?

• Explain structure of C++ program.

• Define pure virtual function.

• What is 'this' pointer?

• What is static data member?

• List types of inheritance.

• Define early binding and late binding.

• What is friend function?

• What is function overloading?

3 Marks Questions

• Write a short note on Exception Handling.

• Write a short note on Function Overriding.

• Write a short note on "This" pointer.

• Write a short note on Operator Overloading.

• Write a short note on Pointer to Object with example.


4 Marks Questions

• Explain operator overloading in C++ with an example.

• Explain memory allocation for objects with non-static and static data members.

• What is pure virtual function? Explain with an example program.

• Explain dynamic constructor with a suitable example.

• What is inheritance? Explain hierarchical inheritance.

• Explain object as function arguments with an example.

• Explain different characteristics of friend function.

• What is class Template? Explain syntax with example.

• Explain memory management operators with example.

• Explain array of objects in C++ with example.

• Explain formatted input/output functions.

• Explain stream classes used for console I/O operations.

• Write a program to overload binary + operator to add two strings.

• Write a program to overload function to calculate area of circle, square, rectangle.

• Explain static data member and static member function with example.

• Write a program to copy content of one file to another file.

• Explain different file opening modes in C++.

• Explain use of setiosflags and setfile manipulators.

4 Marks / Programs

• Write a C++ program to create a class containing two data members, accept, display and
swap numbers using call by reference.

• Write a C++ program to create a class Book (B_id, B_name, B_Author, B_Publication) to
accept and display book info, and count number of books using static data member.

• Write a C++ program to calculate factorial using inline function.

• Design a C++ class with a function display() and count number of times display() is called (use
static data member).

• Write a C++ program to read a text file and count characters, words, and lines.

• Write a C++ program to copy one file content to another file.

• Write a C++ program to compare two strings using overloaded == operator.


• Trace the output of the following program and explain it. Assume there is no syntax error.
# include < iostream.h>
Class abc
{
int i;
public :
abc (int v = 0)
{
Cout <<"In the constructor\n'';
i = v;
}
Void print (Void)
{
Cout <<"The value of i is " <<<endl;
}
};
void main()
{
abc a (10);
abc b;
a.print();
b.print();
}

You might also like