#include<stdio.h>
void main()
{
int i,r;
randomize();
for(i=1;i<=10;i++)
{
r=random(100)
printf("%d\t",r);
}
}
OUTPUT:
82 86 72 23 45 48 88 85 48 21
NOTE:
a) random() takes a number and returns a random number in the range 0 to one less than the given number.
b) randomize() intializes the random number generator with a random value.
void main()
{
int i,r;
randomize();
for(i=1;i<=10;i++)
{
r=random(100)
printf("%d\t",r);
}
}
OUTPUT:
82 86 72 23 45 48 88 85 48 21
NOTE:
a) random() takes a number and returns a random number in the range 0 to one less than the given number.
b) randomize() intializes the random number generator with a random value.
No comments:
Post a Comment