Class: “Format allows you to combine data and the funtion in a single unit is known as class.”
“In this program we find sum of two numbers by using Class.
Let’s write a program to print Sum of two numbers in c++ by using Class.
Step 1: Let’s open turboC++ and write the following Code :
long int a,b,c;
void sum :: input()
cout<<”enter first number:”;
cout<<”enter second number :”;
void sum :: display()
Step 2: Run the program and see output.