# VBForums CodeBank > CodeBank - C++ >  Random Numbr Generator

## paulobatistutta

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!

----------


## Zach_VB6

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

----------


## Zach_VB6

This is the wrong place for it.

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

----------


## S3RP3NT

There was code but I forget it.

----------


## hellowonn

Repeating period? PLZ rephrase question.

----------


## deepu8

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

eg.



```
 #include <cstdlib> 
#include <ctime> 
#include <iostream>

using namespace std;

int main() 
{ 
    srand((unsigned)time(0)); 
    int random_integer = rand(); 
    cout << random_integer << endl; 
}
```

----------

