Help with an issue in lottery program

Last edited on
Hello droodic,

In your first bit of code the problem is with line 14. Each time the for loop starts it only runs once and if the while condition is "y" the for loop will start over thus making "i" always zero.

What you need is to put the "break" in an if/else so the for loop can continue until you type "n".

In the header file "<cctype>" there are functions "tolower()" and "toupper()", among others, that you can use to change the case of "response", either after the input or in an if statement. Very helpful, otherwise in the if statements you should code for upper case and lower case.

You may find the same problem with line 28 of the second bit of code.

Hope that helps,

Topic archived. No new replies allowed.