by alexz003 on July 15th, 2009

alexz003

Question

Help answer this question below.

What do i do if i want to loop my program without goto when while doesn't work? I need it to be able to run a lot of code based off of whether the login was correct or not. I don't want to spaghetti-string all my code based off goto commands.

  • Like
  • Report

Answers. 1 helpful answer below.

  • by TomP-C on July 17th, 2009

    TomP-C

    You can use a FOR LOOP if for example you want to allow three login attempts before a screen comes up saying you've been locked out.

    You can use a DO... WHILE loop or DO...UNTIL loop.

    When you say "WHILE DOESN'T WORK" it sounds as though your real question ought to be what is wrong with this bit of code using a while loop.

    No comments. Post one | Permalink

Want to attach an image to your answer? Click here.

Did this answer your question? If not, then ask a new question or create a poll.

You're reading What do i do if i want to loop my program without goto when while doesn't work? I need it to be able to run a lot of code based off of whether the login was correct or not. I don't want to spaghetti-string all my code based off goto commands.

Follow us on Facebook!

Related Ads

ANSWERBAG BUZZ

Do while loop to handle login attempt
C programming about useing loop
Im going into 8th grade