Produces 100 random numbers - C Data Type

C examples for Data Type:Random Number

Description

Produces 100 random numbers

Demo Code

#include <stdio.h>
#include <stdlib.h>
int rnd(void);
int main()/*  ww  w  . j  ava  2  s  .  c  o m*/
{
   int x;
   puts("Behold! 100 Random Numbers!");
   for(x=0;x<100;x++)
      printf("%d\t",rnd());
   return(0);
}
int rnd(void)
{
   int r;
   r=rand();
   return(r);
}

Result


Related Tutorials