srand()

This is a discussion on srand() within the C++ Programming forums, part of the General Programming Boards category; How do you write three separate functions using rand() to randomly pick a number 1-12 and then write one to ...

  1. #1
    Unregistered
    Guest

    srand()

    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
    Posts
    359
    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, 06:01 PM
  3. Same seed for srand yields different results
    By codegirl in forum C++ Programming
    Replies: 3
    Last Post: 06-23-2003, 03:39 PM
  4. When to srand()?
    By Imperito in forum C++ Programming
    Replies: 1
    Last Post: 05-12-2002, 01:20 AM
  5. srand()... possible reasons for failure
    By lightatdawn in forum C++ Programming
    Replies: 3
    Last Post: 12-18-2001, 02:33 AM

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