Professional Documents
Culture Documents
Name: ___________________________________________________
Stream: __________________________________________________
Semester: _________________________________________________
Registration No: ___________________________________________
Roll No: __________________________________________________
INDEX
Sl. No
Lesson
Introduction of C++
Function in C++
10
this pointer
11
12
Template
Date
Signature
Remarks
****
***
**
*
Source Code
Output:
1.2 Write a C++ program to find the greatest among the three numbers.
Source Code
output:
Q.1 What is Object Oriented Programming (OOP)? Write some of the features of OOP.
Q.2 How does object oriented approach is differ from object based approach?
Q.3 Why do we need the processor directive #include <iostream>?
Q.4 How does the main() function differ in C++ from main() in C?
a. ADD (a, s2) - where a is an integer (real part) and s2 is a complex number.
b. ADD (s1, s2)-where s1 & s2 are complex numbers.1.2 Write a C++ program to
evaluate the following function to 0.0001% accuracy.
Source Code:
Output:
2.5 Create a class COMPLEX that contains two double data members for real and
imaginary part. Write a C++ program to overload unary (-) operator using friend
function.
Source Code:
Output:
Q 2.1 What are the advantages of function prototypes in C++?
Ans:
Q 2.2 What is main advantages of passing arguments by reference?
Ans:
Q 2.3 When will you make a function inline? Why?
Ans:
Q 2.4 When do we need to use default arguments in a function?
Ans:
Q 2.5 What do you meant by overloading a function? When do we use this concept?
Ans:
Q 2.6 What is friend function? Write some characteristics of friend function. What are
the merits and demerits of using friend function?
Ans:
Signature of Subject Teacher