Coders Packet

Random Numbers Generator Using C++

By Paaras Jamwal

This is a C++ program to generate Random Numbers between a specific range and how many random numbers user want to generate with the help of rand() and srand()

In this code, Random Numbers are generated using rand() and srand(). The Random Numbers generated are in the range specified by the user which are taken as input in the code. The range has one minimum value and one maximum value the minimum and maximum values set limits on the range of values that might appear in random numbers.The minimum value identifies the smallest number in the range, and the maximum value identifies the largest number. The numbers of Random Numbers to be generated are taken as input from the user.

srand() will use current time as a seed for random generator and as rand() function is used so that the numbers generated every time will be unique.

Finally, the Random Numbers are printed as the output.

Download Complete Code


No comments yet