write a program to generate Random numbers in c++.

write a program to generate Random numbers in c++.


CODE:

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int n,c;
clrscr();
cout<<"ten random number from 0 to 100\n";
for(c=1;c<=10;c++)
{
n=rand()%100+1;
cout<<c<<"number is:"<<n<<endl;
}
getch();
}

OUTPUT:


Comments