#include<iostream.h>
#include<conio.h>
class addition
{
private:
int a,b,c;
public:
int getdata(int a,int b)
{
int c;
c=a+b;
return c;
}
int dispdata()
{
cout<<"The result of addition is "<<endl<<c;
return 0;
}
};
int main()
{
addition a1;
a1.getdata(2,3);
a1.dispdata();
getch();
return 0;
}
Output result is displayed as 24.
In Above program,iam geeting data(2,3) and displays the result but result is displayed as 24 instead of 5?confused where did i get wrong