Sitemap

OOP C++ Labs

6 min readApr 1, 2026

--

Hello I am Jayad Khan. I am writing this blog about the BCA 3rd semester exam held at LBS P.G. College, Tilak Nagar, Jaipur. CPP Labs.

Q1 : C++ Program to Convert the temperature from Celsius to Fahrenheit.

Program
Output

Q2 : C++ program that reads three sides of triangle find area of triangle.

Program
Output

Q3 : C++ program to compute simple interest and compound interest.

Program
Output

Q4 : C++ program to input three integers and print the largest number.

Program
Output

Q5 : C++ program to find the area and perimeter of circle

Program
Output For Area
Output For Perimeter

Q6 : C++ Program to Check Whether the Given number is palindrome or not.

Program
Optput

Q7 : Write a C++ program to take name, address as character array, age as int salary as float and contains inline functions to set the values and display it.

Program
Output

Q8 : Write a C++ program calculate factorial values using friend function.

Program
Output

Q9 : Write a C++ program read two integer number perform all arithmetic operations using OOPs concept.

Program
Output

Q10 : Write a C++ Program to display Names, Roll No., and grades of 3 students who have appeared in the examination. Declare the class of name, Roll No. and grade. Create an array of class objects. Read and display the contents of the array.

Program
Output

Q11 : Create a class TIME with members hours, minutes, seconds. Take input, add two time objects passing objects to function and display result.

Program
Press enter or click to view image in full size
Output

Q12 : Write a C++ Program to find a simple interest using constructor.

Program
Output

Get Trace Is Empty’s stories in your inbox

Join Medium for free to get updates from this writer.

Q13 : Write a C++Program to demonstrate copy contractors.

Program
Output

Q 14 : Write a C++ program to demonstrate single level inheritance.

Program
Output

Q 15 : Write a C++ program to demonstrate multiple inheritance.

Program
Output

Q 16 : Design three classes STUDENT, EXAM and RESULT. The STUDENT class has data members such as rollno, name. create a class EXAM by inheriting the STUDENT class. The EXAM class adds data members representing the marks scored in six subjects. Derive the RESULT from the EXAM class and has its own data members such as totalmarks. Write a program to model this relationship.

Program
Output

Q 17 : Using the concept of function overloading Write function for calculating the area of triangle, circle and rectangle.

Press enter or click to view image in full size
Program
Output

Q 18 : Write a program to overload unary increment (++) operator.

Press enter or click to view image in full size
Program
Output

Q 19 : Write a program to overload binary + operator.

Press enter or click to view image in full size
Program
Output

Q 20 : Write a C++ program read two numbers (any type) swap these number using function template.

Press enter or click to view image in full size
Program
Output

Q 21 : Write a Program to Access Members of a STUDENT Class Using Pointer to Object Members.

Press enter or click to view image in full size
Program
Output

Q22 : Write a program containing a possible exception. Use a try block to throw it and a catch block to handle it properly.

Press enter or click to view image in full size
Program
Output

Q 23 : Write a program to read a set of lines from the keyboard and to store it on a specified file.

Press enter or click to view image in full size
Program
Output

Q24 : Write a program to read a text file and display its contents on the screen.

Program
Output

Q 25 : Write a program to read the class object of student_info such as name, age, sex, height and weight from the keyboard and to store them on a specified file using read () and write () functions. Again the same file is opened for reading and displaying the contents of the file on the screen.

Program
Output

Thanks for reading this blog. I hope you liked it.

--

--