SUM

Home >> Sem 2 >> C++ programs >> SUM

#include<iostream.h>
#include<conio.h>
class sum
 {
   int a,b;
   public:
   sum()
    {}
     int getdata(int , int);
 };

 int sum:: getdata(int a,int b)
  {
     int sum;
     sum = a + b;
     return sum;
  }

void main()
{
   sum s1;
   int a,b;

   clrscr();

   cout<<"Enter Number : ";
     cin>>a;
   cout<<"Enter Number : ";
     cin>>b;
   cout<<"The sum : "<<s1.getdata(a,b);

   getch();
}