In this c programming tutorial we are going to see how we can generate random numbers. Random numbers can be generated in c using randomize() function which initializes the random number generator with a random value based on time. You can try the sample program given below in Turbo-C, it may not work as expected in other compilers.
/* Prints a random number in the range 0 to 99 */
printf("Random number in the 0-99 range: %d\n", random (100));