Horje
1 TO HUNDRED RANDOM NUMBER CPP Code Example
1 TO HUNDRED RANDOM NUMBER CPP
#include <iostream>
#include <random>
int main()
{
    std::random_device rd; // obtain a random number from hardware
    std::mt19937 gen(rd()); // seed the generator
    std::uniform_int_distribution<> distr(25, 63); // define the range

    for(int n=0; n<40; ++n)
        std::cout << distr(gen) << ' '; // generate numbers
}




Cpp

Related
console colors in C++ Code Example console colors in C++ Code Example
c++ function as pointer Code Example c++ function as pointer Code Example
For loop c++ Code Example For loop c++ Code Example
create copy constructor c++ Code Example create copy constructor c++ Code Example
c++ random number within range Code Example c++ random number within range Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11