Search

Sabtu, 14 April 2012

Display Random Numbers

Today I will share the coding of the basic programming using Borland C + +, may be useful for the friend my friend as well.
 Display Random Numbers

#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
void main()
{
   int boundary,k,random[50],boundary[50];
   int max;
   randomize();
   cout<<"Enter the Numbers Between 1-100 to determine the random = ";
   cin>>boundary;
   cout<<"Data : "<<endl;
   for(int i=0;i<10;i++)
   {
        random[k]=random(boundary);
       cout<<random[k];
      boundary[i]=random[k];
      cout<<endl;
   }
    max=boundary[0];
   for(int i=0;i<10;i++)
   {
      if(boundary[i]>max)
          max=boundary[i];
   }
   cout<<"largest data = "<<max<<endl;
    getch();
}
good luck with my friends :)


Tidak ada komentar:

Posting Komentar