Thread: C++ Functions

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

    C++ Functions

    If I have 5 user-inputed numbers, how would I make a function that could return the lowest number?

  2. #2
    The larch
    Join Date
    May 2006
    Posts
    3,573
    How would you make one that would return the lowest of two?
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    19
    No, I have a function already. I just have to know what the write inside it so that it returns the lowest of the 5 numbers.

  4. #4
    The larch
    Join Date
    May 2006
    Posts
    3,573
    How would you write a function that returns the lowest of three values? (You can reuse the function that returns the lowest of two.)

    It's not the policy here to write code for you, especially as you have not posted anything that you have tried or having trouble with.

    For example, it is pretty important to know if those five values are supposed to be in an array / container (because then the function already exists in the standard library).
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Void Functions Help
    By bethanne41 in forum C++ Programming
    Replies: 1
    Last Post: 05-09-2005, 05:30 PM
  2. Functions and Classes - What did I do wrong?
    By redmage in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2005, 11:50 AM
  3. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM
  4. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  5. Shell functions on Win XP
    By geek@02 in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2004, 05:39 AM