Thread: srand()

  1. #1


    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.

  2. #2
    Registered User subdene's Avatar
    Join Date
    Jan 2002
    Why are you reposting the same question again? XSquared all ready gave you a solution in your rand() post.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Use srand() twice in a function?
    By Jake.c in forum C Programming
    Replies: 5
    Last Post: 01-21-2009, 12:51 PM
  2. srand() in .Net
    By Sad Programmer in forum C++ Programming
    Replies: 6
    Last Post: 07-28-2003, 05:01 PM
  3. Same seed for srand yields different results
    By codegirl in forum C++ Programming
    Replies: 3
    Last Post: 06-23-2003, 02:39 PM
  4. When to srand()?
    By Imperito in forum C++ Programming
    Replies: 1
    Last Post: 05-12-2002, 12:20 AM
  5. srand()... possible reasons for failure
    By lightatdawn in forum C++ Programming
    Replies: 3
    Last Post: 12-18-2001, 02:33 AM