pls explain about time() and how it work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers