View Single Post
Old Jan 2nd, 2006, 1:39 AM   #1
cairo
Newbie
 
Join Date: Dec 2005
Posts: 18
Rep Power: 0 cairo is on a distinguished road
tossing coin, logic problem ?

for (int i=0; i<100; i++)
{
if(toss()>=1)
head++;

else
tail++;
}


bool toss()
{
srand(time(0));
return rand()%2;
}



logic problem ? i cant figure out the problem. can somebody tell me the what happened ?
why i stil get the same result each time i call the toss function ?
cairo is offline   Reply With Quote