Please help me run this program, i forgot the output of this..
#include<iostream>
#include<cmath>
using namespace std;
class SumTwoNumbers
{
int nx,ny,sum,suma,sumtn;
public:
int GetFirstNumber();
int GetSecondNumber();
int GetSum(int,int);
void Display(int,int);
}stn;
int SumTwoNumbers::GetFirstNumber()
sum=nx+ny; //here is where the errors i wrote below points! i dont know why
return(sum);
int SumTwoNumbers::GetSecondNumber()
suma=nx+ny;
return(suma);
int SumTwoNumbers::GetSum()
sumtn=sum+suma;
return(sumtn);
int SumTwoNumbers::Display()
stn.GetSum(sum,suma);
int main()
{
int a,b,c,d;
SumTwoNumbers stn;
cout<<"Enter two Numbers: ";
cin>>a>>b;
cout<<"Enter two Number: ";
cin>>c>>d;
system("cls");
cout<<"Sum of FirstNumber: "<<stn.GetFirstNumber()<<endl;
cout<<"Sum of Second Number: "<<stn.GetSecondNumber()<<endl;
cout<<"Sum of Two Numbers: "<<stn.Display();
return 0;
}
these are the errors:
c:\documents and settings\user\desktop\cpp\try\untitled1.cpp(24) : error C2146: syntax error : missing ';' before identifier 'sum'
c:\documents and settings\user\desktop\cpp\try\untitled1.cpp(24) : fatal error C1004: unexpected end of file found
please help me