Check out example codes for "how to get random numbers in c". It will help you in understanding the concepts better.

Code Example 1

#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;
}

Learn ReactJs, React Native from akashmittal.com