I am making a function to make different random value when I run the executable file again. This is my function to make a bit 0 and 1. The first time, I run it and get output is 0 1 1 1. And I run the .exe the output is same with prior time. What is happening? I want different output when I run again. Can you help me?
int randBit()
{
int bit;
double randval;
randval = (double)rand()/(double)RAND_MAX;
if(randval<0.5) bit=0;
else bit=1;
return bit;
}