c program to generate random numbers

This c program generates random numbers using random function, randomize function is used to initialize random number generator. If you don't use randomize function then you will get same random numbers each time you run the program.

C programming code using rand

#include <stdio.h>
#include <stdlib.h>
int main() {
  int c, n;
  printf("Ten random numbers in [1,100]\n");
  for (c = 1; c <= 10; c++) {
    n = rand()%100 + 1;
    printf("%d\n", n);
  return 0;

C programming code using random function(Turbo C compiler only)

   int n, max, num, c;
   printf("Enter the number of random numbers you want ");
   printf("Enter the maximum value of random number ");
   printf("%d random numbers from 0 to %d are :-\n",n,max);
   for ( c = 1 ; c <= n ; c++ )
      num = random(max);
   return 0;