Displaying highest and lowest values

This is a discussion on Displaying highest and lowest values within the C++ Programming forums, part of the General Programming Boards category; Hello i'm very new too C++ But I basically need to know how to write a simple small program that ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    1

    Displaying highest and lowest values

    Hello i'm very new too C++

    But I basically need to know how to write a simple small program that displays the highest value and lowest value of a string of user inputted digits. I think its if else's but to be honets i'm completly lost! Can anyone help me out please?

    Thankyou!

  2. #2
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Keep variables which store highest and lowest values.

    Loop through each entry and check if it's higher than the previous recorded highest, or lower than the previous recorded lowest.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,598
    What have you tried so far? Note the policy on homework.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    adr
    adr is offline
    Registered User
    Join Date
    Dec 2005
    Posts
    155
    Quote Originally Posted by laserlight
    What have you tried so far? Note the policy on homework.
    LOL, it could be homework, but doesnt mean we cant help him. Just you'll have to still do the work.... http://www.cppreference.com/cppstring/index.html is a site I found a long time ago about strings you can check out. It will help you get you started and then do what Cat said after you understand what your looking at. Hope that helps.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extracting lowest and highest score from array
    By sjalesho in forum C Programming
    Replies: 6
    Last Post: 03-01-2011, 05:24 PM
  2. Replies: 3
    Last Post: 02-22-2009, 01:54 PM
  3. Sorting an int array highest to lowest
    By switchback in forum C Programming
    Replies: 3
    Last Post: 07-27-2008, 03:30 AM
  4. Trying to sort numbers from lowest to highest
    By jw232 in forum C++ Programming
    Replies: 21
    Last Post: 01-21-2008, 03:03 PM
  5. did i do this right?
    By Joldil in forum C++ Programming
    Replies: 8
    Last Post: 07-25-2007, 02:43 AM

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