Is there a function to generate a random int number in C? Or will I have to use a third party library?
#include #include int random(int range); int main(void) { printf("%d", random(10)); return 0; } int random(int range) { struct time t; int r; gettime(&t); r = t.ti_sec % range; return r; }