Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > displaying the largest and smallest number

Reply
Thread Tools

displaying the largest and smallest number

 
 
Keke922
Guest
Posts: n/a
 
      11-01-2003
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?
 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      11-01-2003
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.


 
Reply With Quote
 
 
 
 
Shane Beasley
Guest
Posts: n/a
 
      11-02-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Keke922) wrote in message news:<(E-Mail Removed)>...
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The smallest and largest values of numeric types tom@finland.com Python 9 04-18-2007 02:35 PM
Algorithm to find nth largest or nth smallest in a range Code4u C++ 4 07-13-2005 03:18 AM
Finding next largest/smallest floating point value Peter Ammon C Programming 13 06-15-2004 04:25 AM
Browser: view/text size/smallest to largest Sanitarium HTML 2 12-04-2003 09:18 PM



Advertisments