+ 1

pls explain about time() and how it work?

#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { srand(time(0)); for (int x = 1; x <= 10; x++) { cout << 1 + (rand() % 6) << endl; } } pls explain about this program's functionality.

25th Sep 2017, 3:00 PM
Shivani Goyal
0 odpowiedzi