The below implementation is to generate random number from 1 to given limit. The below function produces behavior similar to srand() function.
Prerequisite : random header in C++ | Set 1(Generators)
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Program to generate random alphabets
- Generate a random permutation of 1 to N
- Generate a random permutation of elements from range [L, R] (Divide and Conquer)
- Generate a number such that the frequency of each digit is digit times the frequency in given number
- C++ Program for How to check if a given number is Fibonacci number?
- random header in C++ | Set 3 (Distributions)
- Random-access Iterators in C++
- random header | Set 2 (Distributions)
- random header in C++ | Set 1(Generators)
- std::generate in C++
- Program for n-th even number
- C/C++ Program for n-th Fibonacci number
- Program for Sum of the digits of a given number
- C++ Program to find sum of even factors of a number
- Program to find absolute value of a given number
- C program to find Decagonal Number
- Program to delete Nth digit of a Number
- Program to find the number of men initially
- Code to generate the map of India (with explanation)
- Generate all the binary strings of N bits
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.