I'm trying to get it to work like if I earned 5 apples but I only earned 2 - I want it to be able to detect no and yes and let me either input the right amount or go to the next question.
Code:#include <iostream> using namespace std; int main() { int thisisanumber; cout<<"How many apples have you earned?"; cin>> thisisanumber; cin.ignore() ; cout<<"You entered: "<< thisisanumber <<"\n"; int thisisno; int thisisyes; cout<<"Is this amount correct?"<< thisisno <<"\n"; cin>> thisisno; cin>> thisisyes; cin.ignore() ; cout<<"Please enter the correct amount:"<< thisisno <<"\n"; cout<<"How many grapes have you earned?"<< thisisyes <<"\n"; cin.get(); }



LinkBack URL
About LinkBacks


