- #1
tj00343
- 63
- 0
This program is supposed to add 2 integers ,according to the compiler, there are 2 warnings and 1 error ,the error is (undefined symbol' end')
the warnings are 'sum' and 'y' are declared but never used
here is the program :
# include <iostream>
# include <conio.h>
intmain()
{
int x;
int y;
int sum;
cout<< "enter 2 integers " ;
cin>>x ;//read an integer and store it in sum x+y ; x
cout<<"the sum of" <<x<< "and" <<y<< "is" <<sum<< end;
getch();
return 0;
}
What's wrong with it. thanks in advance to anyone who answers
Btw. the compiler I'm using is Borland C++ 5.0
the warnings are 'sum' and 'y' are declared but never used
here is the program :
# include <iostream>
# include <conio.h>
intmain()
{
int x;
int y;
int sum;
cout<< "enter 2 integers " ;
cin>>x ;//read an integer and store it in sum x+y ; x
cout<<"the sum of" <<x<< "and" <<y<< "is" <<sum<< end;
getch();
return 0;
}
What's wrong with it. thanks in advance to anyone who answers
Btw. the compiler I'm using is Borland C++ 5.0