This program tell you how to Generate a Random no. every time u run the program.


#include<iostream.h>
#include<conio.h>
#include<stdlib.h>

void main()

{

int rnum ,i ;

for (i=0; i<=5; ++i)

cout<<(rnum=rand() ) << endl;

getch();

};


Now See here Rnum is used to get random number.

 i<=5 it means that it will select from 1 to 5 number it self
Designed By Blogger Templates | Templatelib & Distributed By Blogspot Templates