Thread: Loop, Inputs

  1. #1
    Registered User
    Join Date
    Sep 2011

    Loop, Inputs

    I've have this assignment which I'm unsure of how to start.

    I'll be asking parts by parts.

    In the first part, the user will be prompted to enter a number of inputs which is undefined. This means he could enter any number of them up till a reasonable number like 256.

    After which, we'll need to read those input and run them thru a switch case to do some simple calculation.

    I'm now stuck on the first part. How to get those input and how to assess them later.

    Thanks for whatever help I'll be getting in advance.

  2. #2
    Registered User
    Join Date
    May 2011
    Around 8.3 light-minutes from the Sun
    Well, why don't you read: Lesson 3: Loops and then Lesson 8: Arrays. I am assuming you know how to do basic input and output.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    Registered User
    Join Date
    Sep 2011
    I've tried.

    I tried using a do while loop to get the inputs. however, i have no idea how to store him for use in the later parts.

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Post #2, 2nd link. Read it.
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to handle inputs if the user inputs the wrong thing
    By bassist11 in forum C Programming
    Replies: 5
    Last Post: 09-22-2010, 04:28 AM
  2. Help with inputs
    By RustySpoon in forum C Programming
    Replies: 3
    Last Post: 03-14-2010, 09:38 PM
  3. Average of user inputs (in a loop)
    By SilentPirate007 in forum C Programming
    Replies: 13
    Last Post: 03-08-2010, 06:46 PM
  4. How do I validate these inputs?
    By Kyeong in forum C Programming
    Replies: 1
    Last Post: 10-19-2008, 02:20 PM
  5. trouble with creating a loop to read certain number of inputs
    By import tuner650 in forum C++ Programming
    Replies: 2
    Last Post: 03-20-2008, 07:28 PM