Results 1 to 6 of 6

Thread: Random Numbr Generator

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    1

    Random Numbr Generator

    How can I generate numbers with long long period (for example group of 10 numbers (1 to 100) will repeat after couple long time : 1 2 3 4 5 6 7 8 9 10 .... compute.... long period ... lot of numers (1 to 100) .... 1 2 3 4 5 6 7 8 9 10.... It means, I need R.N.D. with long repeating period. Is it possible in C++ ( Microsoft isual Studio 2005) ?
    Thanksfor your response. By by!

  2. #2
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Re: Random Numbr Generator

    You may want to rephrase the question so those that speak English can understand it.

  3. #3
    Frenzied Member
    Join Date
    Dec 2007
    Posts
    1,072

    Re: Random Numbr Generator

    This is the wrong place for it.

    Should be here: http://www.vbforums.com/forumdisplay.php?f=9

  4. #4
    New Member
    Join Date
    Aug 2008
    Location
    Serbia.
    Posts
    3

    Re: Random Numbr Generator

    There was code but I forget it.

  5. #5
    Member
    Join Date
    Apr 2008
    Posts
    42

    Re: Random Numbr Generator

    Repeating period? PLZ rephrase question.

  6. #6
    Banned
    Join Date
    Mar 2009
    Posts
    17

    Re: Random Numbr Generator

    rand(); is used to select the random number.

    eg.

    Code:
     #include <cstdlib> 
    #include <ctime> 
    #include <iostream>
    
    using namespace std;
    
    int main() 
    { 
        srand((unsigned)time(0)); 
        int random_integer = rand(); 
        cout << random_integer << endl; 
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width