Question Bank 1 and 2 Unit
Question Bank 1 and 2 Unit
Question Bank
Unit 1 and Unit 2
1Design a class ‘Complex’ with data members for real and imaginary part. Provide default and
Parameterized constructors. Write a program in c++ to perform a Subtraction of two complex numbers.
4.Write down a c++ program for copy constructor for string Class.
11.What is use of constructor? State four type of Constructor. Write a program in C++ for any one type.
15.Write a c++ program to swap to integer number. Write separate Swap function using reference
variable.
16.Define class number which has inline function mult() and Cube() for calculating multiplication of 2
double number given and cube of integer number given.
17.What are inline function? What are their advantages? Give an example.
18.What is mean by Constructor and destructor? Write down a c++ program for copy constructor.
a.Class
c.Inline Function