Loops

This is a discussion on Loops within the C Programming forums, part of the General Programming Boards category; so if im running a option saying press one for something and 2 for another option how to i get ...

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    41

    Angry Loops

    so if im running a option saying press one for something and 2 for another option how to i get my program to go back to the original input area so that they can either choose the same option or a differnent one:

    printf("Press 1 for this press two for that:"); scanf("%d", &option);
    rule;
    rule ;
    rule;
    rule;

    (loop back to the top......

    pressing 1 will list rules and after it lists the rules i want it to go back and ask the user for input again, how do i do that?

    so what to i write at the end of that to make it loop to the first printf statement?????????
    Last edited by gloworm; 04-02-2010 at 07:45 PM.

  2. #2
    Just a pushpin. bernt's Avatar
    Join Date
    May 2009
    Posts
    426
    Funny, really, how it works out. There just happens to be a tutorial on C loops here:
    Cprogramming.com Tutorial: Loops
    Note the titles of the other tutorials; that way you'll know where to go next time you have a question like "how do I implement a loop?"
    I'll leave it at that.
    Consider this post signed

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    41
    awesome thank you so much, but next time try not to be so sarcastic when someone is asking for help. But your answer was EXTREMELY helpful so thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Loops Trouble
    By rlframpton in forum C Programming
    Replies: 2
    Last Post: 04-17-2009, 02:08 AM
  2. Too many loops D:
    By F5 Tornado in forum C++ Programming
    Replies: 6
    Last Post: 12-03-2007, 01:18 AM
  3. loops with incrementing strings .... ?
    By twomers in forum C++ Programming
    Replies: 1
    Last Post: 12-12-2005, 11:29 AM
  4. Evaluation of nested loops
    By Mister C in forum C Programming
    Replies: 2
    Last Post: 08-13-2004, 02:47 PM
  5. help with arrays and loops
    By jdiazj1 in forum C Programming
    Replies: 4
    Last Post: 11-24-2001, 04:28 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21