C++ program to generate random numbers between 1 and 100.
For random() function, stdlib.h header file is required.
randomize() function will generate different random numbers each time you run the program.
If you don’t include randomize() function it will generate the same random numbers whenever you run this program.
For random() function, stdlib.h header file is required.
randomize() function will generate different random numbers each time you run the program.
If you don’t include randomize() function it will generate the same random numbers whenever you run this program.
#include<iostream.h> #include<conio.h> #include<stdlib.h> void main() { clrscr(); randomize(); for (int i=1; i <= 10; i++) { cout << random(100) << endl; } getch(); }