Tuesday 28 January 2014

c program for generate random number



c program for generate random number : 


#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
 
main()
{
   int n, max, num, c;
 
   printf("Enter the number of random numbers you want ");
   scanf("%d",&n);
 
   printf("Enter the maximum value of random number ");
   scanf("%d",&max);
 
   printf("%d random numbers from 0 to %d are :-\n",n,max);
   randomize();
 
   for ( c = 1 ; c <= n ; c++ )
   {
      num = random(max);
      printf("%d\n",num);
 
   }
 
   getch();
   return 0;
}

1 comment:

Anonymous said...

If you wish for to obtain much from this piece of
writing then you have to apply such strategies to your won blog.


Check out my site; diy home renovation