Advanced programs

C++ program for overloading the unary operator ++.

ALGORITHAM: • Start the process • Invoke the class counter • Crate two objects c1 and c2 • Assign values to c1 an c2 o Call c1.get_count() o Call c2.get_count() • Increment the values o C1++ o C2++ o ++c2 • Print c1 and c2 • Stop the process PROGRAM #include<iostream.h> #include<conio.h> class counter { […]


C++ program to swap two variables using function overloading

FUNCTION OVERLOADING AIM: A program to demonstrate how function overloading is carried out for swapping of two variables of the various data types, namely integer, floating point number and character types ALGORITHAM: • Start the process • Get the integer values of ix,iy • Get the floating values of fx,fy • Get the character values […]


c++ Program to illustrate the use of difference operators using friend function

AIM: A program to illustrate the use of difference operators to access the class member using friend function ALGORITHM: 1) Start the process 2) Invoke the classes 3) Call the set_xy() first a) Assign the value of x and y b) Print the value of x and y 4) Call the sum() for second(friend) a) […]


C++ program to print student details using constructor and destructor

CONSTRUCTOR AND DESTRUCTOR AIM: A program to print student details using constructor and destructor ALGORITHAM: 1. Start the process 2. Invoke the classes 3. Call the read() function a. Get the inputs name ,roll number and address 4. Call the display() function a. Display the name,roll number,and address of the student 5. Stop the process […]


C++ program for implementation of class

AIM: A program to solve a quadratic equation, using OOP techniques. ALGORITHM: 1) Start the process 2) Invoke the classes 3) Get the input for a,b,c; 4) Call the function getinfo() and display() 5) Check if a=0 a) True : compute c/b; i) Print the value of a/c; b) False: compute b*b-4*a*c; i) If ( […]