Random Number

 #include <iostream>

#include <cstdlib>

#include <ctime>


using namespace std;


int main()

{

    int x;


    cout << time(0); //IMPORTANT


    srand(123);


    for(x; x<30; x++){

        cout << (rand()%31)+15 << endl; //IMPORTANT

    }

}


Comments

Popular posts from this blog

Hackerearth Pr1.

Avg age of any no. of ppl for loop