Originally Posted by
clockworkworks
you need a conditional statement “if” not a while loop, you could use a recursive method by using if else , that will solve your problem or at least give you a start...
In an Intro to Programming class, I doubt that recursion has been covered.
As far as the program is concerned, you have a nested loop in which the outer loop, if r1 and r2 are both positive integers, will have stuck you in an infinite loop.
Make the while statement into an if-else statement, where the program re-asks the user for numbers if r1 and r2 are invalid, else the program executes normally.