SOURCE CODE
#include “iostream.h”
#include “conio.h”
class add
{
private:
int inum1,inum2,inum3;
public:
add(void);
add(int,int);
void input(int,int);
void sum(void);
void disp(void);
};
add::add(void)
{
inum1=inum2=inum3=0;
}
add::add(int ix,int iy)
{
inum1=ix;
inum2=iy;
inum3=0;
}
void add::input(int ivar1,int ivar2)
{
inum1=ivar1;
inum2=ivar2;
}
void add::sum(void)
{
inum3=inum1+inum2;
}
void add::disp(void)
{
cout << "\n The Sum Of Three Numbers Is " << aptr="new"> sum();
aptr-> disp();
a2.disp();
getch();
}
OUTPUT
The Sum Of Three Numbers Is 13
The Sum Of Three Numbers Is 7
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24