123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

   Computer Science / IT
   Electronics
   Electrical
   Mechanical
   Chemical
   Civil

   CAT / MBA

   GMAT / Foreign MBA
Latest Jobs

Engineering Jobs / Technical Jobs
Management Jobs

Sitemap
Terms of use

Displaying  Source Code(s)  
 

 
Generating N Random Numbers between two specified numbers.

--------------------------------------------------------------------------------

Description : Program to Generate N Random Numbers Between Any Two Specified Numbers.

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>
void main()
{
clrscr();
int min,max,i,range,r,x;
unsigned first = time(NULL);
cout<<"FIRST = " << first <<endl;
srand(first);
cout<<"ENTER THE MINIMUM NUMBER :";
cin>>min;
cout<<"ENTER THE MAXIMUM NUMBER :";
cin>>max;
cout<<"ENTER THE NO.OF TERMS YOU WANT :";
cin>>x;
range=max-min+1;
for(i=0;i<x;i++)
{
r=rand()/100%range+min;
cout<<r<<" ";
}
getch();
}

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG