I am trying to run a for loop that starts at 2 and increments by 1 to 4 and it is inside a while loop that ends if q=2. What I'm trying to do is exit the whole program or start the while loop over even if the for loop hasn't gotten to 4 yet. Heres what I have
for i=2:4 if (i==2) g=input('Enter guess 2'); if (g>x) disp('Your guess was too big') elseif (g==x) disp('You Win!') w=w+1; e=input('To play again enter 1, To quit enter 4'); switch e case 1 q=1; case 4 q=2; end
Best Answer