I am developing a calculator program in c++. But the problem is when I try to convert the character into integer it shows runtime error. The code is given below.
#include
#include
void main()
{
clrscr();
int num,sum=0;
cout<<"Enter the number"< cin>>num;
while(num!='=')
{
sum=sum+num;
cin>>num;
}
cout<<"The sum is"< getch();
}
The program runs well i.e it takes the input correctly but when I used to press '=' sign then it shows nothing but only the black screen. Please help me. Thankyou.
No comments:
Post a Comment