Thread: functions

  1. #1
    Unregistered
    Guest

    functions

    How do you write three separate functions using rand() to randomly pick a number 1-12 and then write one to randomly pick a character(the five math operators) without being in the main ().
    Then write another function to get two of the numbers and an operator.(Using stdlib.h,time.h,iostream.h)

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    151
    Do you have a problem?

    http://www.cprogramming.com/cboard/s...highlight=rand
    http://www.cprogramming.com/cboard/s...highlight=rand
    http://www.cprogramming.com/cboard/s...highlight=rand

    Yes, I think so.

    If the requirements have changed, post some code to show you've attempted it. Somebody will tell you where you're going wrong.

  3. #3
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    There, whoever you are who keeps asking, I modified it so that it only uses stdlib.h, time.h, and iostream.h. Just go to Emeduranki's links and you'll find the updated code.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

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