help pls im newbie every time i type quit it will turn to infinite loop :(
did i miss something ?
question:
Write a program that continuously accepts and computes the sum of a number. If the user enters quit the looping stops
my code:
1 2 3 4 5 6 7 8 9 10 11
int main()
{ string z;
int x,sum;
do{
cout<<"enter a number: ";
cin>>x;
cout<<"sum: "<<(sum=sum+x)<<endl;}
while(z!="quit");
return 0;
}