Alrite, thanks for coming to my rescue.
My problem, A const integer is declared and initialised to 250.So when the user enters 200,if the value the user entered was less than the const(250) I want a loop that keeps asking the user to add more to the initial input, 200 until it gets to 250 or more than 250
1 2 3 4 5 6 7 8 9 10 11 12 13
int input;
constint total = 250;
cout<<"Enter input:";
cin>>input;
if(amount<total_cost){
do{
cout<<"Enter more money: ";
cin>>newamount;
newamount = newamount + amount;
}while(newamount<=total);
cout<<"Thank you";
Okay, so the user enters a value say, 200. A different int total exists where it stores 450.
when the user enters a value say 200, I want to cross-check it with the int total variable and see if its less than 450, if it is I want to keep asking the user to keep entering more until it reaches or is more than 450, keeping in mind the initial values entered by the user.
how do I add all those initial values entered and see if it has reached or is more than 450.....make sense....thanks