ok my question is if a person in used my code and pressed 0 to not roll how do you repeat it again until the user enters 1 for yes?
Code://adds the iostream library to the program #include <iostream> //adds the iomanip library to the program #include <iomanip> //adds the math library to the program #include <cmath> // this one is for the system library =) #include <cstdlib> //informs the compiler you are using the standard library set using namespace std; int num1,num2; int yes; int main () { cout << "Chapter Program 5\n"; cout << "Round 1\n"; cout << "Would you like to roll this round? [1 for yes, 0 for no]:"; cin >> yes; if (yes < 1) cout << "Would you like to roll this round? [1 for yes, 0 for no]:"; else cout << "You have rolled a" << num1 << "and a" <<num2 << endl; { } system("pause\n\n\n\n"); return 0; }



LinkBack URL
About LinkBacks



