I wrote this code it generates ramdom numbers but the problem is that it keeps gererating the same random numbers all the time how do i make it so the code generates different ramdom numbers all the time. Plus I would like to have the random numbers from -0.5 to 2.5
can some one point me to the right direction.
Code:#include <stdio.h> #include <time.h> int main() { int i,a; for (i = 0; i < 10; i++) { a=rand(); printf("%d\n",a); } return 0; }