C Program to Generate Random Number

Prem Tiwari - - C Programming Tutorial


This c program will generate the random numbers using rand() function. This is a very simple program. In this program, we have used for loop to generate multiple random numbers.

As an example we print only the 10 numbers, you can generate as much you can by changing the number from 10 to as you want in for loop.

c program to generate random numbers

C program to generate random numbers

The output of below program will be different every time when you execute this program, because of we have used the rand() function.

Ten random numbers between 1 and 1000
384
887
778
916
794
336
387
493
650
422


Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer and a blogger by hobby.

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.