Thread: please i need help in FUNCTIONS

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    2

    please i need help in FUNCTIONS

    i have a project as following
    write c++ program :
    1- main function reads two integers
    2- min1 function takes 2 integer & return minimum
    3- min2 function takes 2 integer & print minimum
    4-min3 function reads two integer & return minimum
    5-min4 function reads two integer & print minimum

    in main function call min1 & min2 for the two entered integers

    in min1 before return statement call min4

    in min4 call min3


    can anyone tell me what can i do for this?
    i have to submit this tomorrow



    thank you

  2. #2
    -bleh-
    Join Date
    Aug 2010
    Location
    somewhere in this universe
    Posts
    463
    Here's the if statement for min, write the functions around that.
    Code:
    if ( x <= y)
        return x; 
    else
        return y;
    "All that we see or seem
    Is but a dream within a dream." - Poe

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well you can have a go at writing it I guess.

    I mean, simply inputting two integers in main() ought to be possible, even for you.
    Otherwise, it looks like you're just trying to score free homework with 0% effort.

    > i have to submit this tomorrow
    So you've been sitting on the problem for a few days, and now you're trying to make your emergency our problem?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    May 2011
    Posts
    2
    nimi thank you very much

    Mr. Salem instead of this philosophy you can help , but Make them for yourself

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    NO - do your own homework, or drop the course.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User inequity's Avatar
    Join Date
    Nov 2010
    Location
    Seattle, Washington
    Posts
    59
    Quote Originally Posted by Kryptonite View Post
    Mr. Salem instead of this philosophy you can help
    hahahahaha

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    My philosophy is simple - it's to keep loser wannabe programmers who think they can scam their way into the workplace, OUT OF THE WORKPLACE!
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating Functions & passing information to other functions
    By RyanLeonard in forum C Programming
    Replies: 4
    Last Post: 10-28-2010, 12:17 PM
  2. Functions calling other functions.
    By kbro3 in forum C++ Programming
    Replies: 2
    Last Post: 12-27-2009, 12:10 AM
  3. Replies: 7
    Last Post: 04-19-2006, 11:17 AM
  4. Replies: 6
    Last Post: 05-06-2003, 03:08 PM
  5. Replies: 1
    Last Post: 01-20-2002, 11:50 AM