displaying the largest and smallest number

Discussion in 'C++' started by Keke922, Nov 1, 2003.

  1. Keke922

    Keke922 Guest

    I have to write a program that allows the user to enter a series of integers
    and -99 when they want to exit the loop. How do I display the largest and
    smallest number the user entered?
     
    Keke922, Nov 1, 2003
    #1
    1. Advertising

  2. Keke922

    osmium Guest

    Keke922 writes:

    > I have to write a program that allows the user to enter a series of

    integers
    > and -99 when they want to exit the loop. How do I display the largest and
    > smallest number the user entered?


    Establish two variables, smallest and largest. The first number you read is
    both the largest *and* smallest. For the rest of the numbers see if that
    number overrides an earlier decision.
     
    osmium, Nov 1, 2003
    #2
    1. Advertising

  3. (Keke922) wrote in message news:<>...
    > I have to write a program that allows the user to enter a series of integers
    > and -99 when they want to exit the loop. How do I display the largest and
    > smallest number the user entered?


    This is answered in the FAQ:

    <http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2>

    While you're at it, read the rest of it:

    <http://www.parashift.com/c++-faq-lite/>

    - Shane
     
    Shane Beasley, Nov 2, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sanitarium
    Replies:
    2
    Views:
    544
    Whitecrest
    Dec 4, 2003
  2. Peter Ammon
    Replies:
    13
    Views:
    3,863
    Arin Chaudhuri
    Jun 15, 2004
  3. Code4u
    Replies:
    4
    Views:
    2,648
    Stephen Howe
    Jul 13, 2005
  4. Replies:
    9
    Views:
    444
  5. Dmitry Chichkov
    Replies:
    9
    Views:
    1,553
    Dmitry Chichkov
    Sep 3, 2010
Loading...

Share This Page