lEtS cODe
I hope my programs help you a bit. .............(Pradeep)
Saturday, August 20, 2011
C Program to generate a bunch of random numbers
#include <stdlib.h>
#include <stdio.h>
const int MAX = 40;
int main()
{
int index;
for (index = 0; index < 20; ++index) {
int number;
number = rand();
printf("%d\n", (number % (MAX-1)) +1);
}
return (0);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment