c rand range
snippet in c

c rand range

user7657

rand() % (max_number + 1 - minimum_number) + minimum_number

how to get random numbers in c

user6180

#include <stdio.h>

int main(){
    int i = 0;
    while(i < 50)
    {
        int num;
        num = rand(); //this function generates the random number
        printf("%i\n", num);
        i++;
    }

return 0;
}

random number generator c

user7320

rand() % (maxlimit + 1 - minlimit) + minlimit;