rand() function c range code example
Example 1: c rand range
rand() % (max_number + 1 - minimum_number) + minimum_number
Example 2: random number generator c
rand() % (maxlimit + 1 - minlimit) + minlimit;
rand() % (max_number + 1 - minimum_number) + minimum_number
rand() % (maxlimit + 1 - minlimit) + minlimit;