i'm trying to get random numbers in a loop like this
#include <stdio.h>
#include <time.h>
int getRand ( int a , int b )
{
return a+rand()%(b-a+1);
}
int main()
{
srand ( time( NULL ) ) ;
int i;
for(i=0 ; i<6 ; i++)
printf("%d\n",getRand(0,9));
return 0;
}
the problem is that i keep getting the same number