Originally posted by datainjector
and ya i said

if ( cointoss()= 0 )
printf ("Heads");
else
IF ( cointoss() == 1 )
printf ("Tails");

well it should print the stuff 100 times right..but the if else stament was wrong because it would count say tails 20 and heads 50 but thats
70 ..so i removed the else if statment and replacet it with else which finally.worked

Well u guys dint c that mistake [/B]
We "didn't see that mistake" because it is not in your original code!

The real reason that code would be wrong is because you're actually calling the function twice, getting two potentially different results from the call.

This is why that'd be wrong. Again, the reason "we didn't see it", is because that code snipped is not in your orignial code.

And you are wrong. They were both right. Your code example didn't call the coin toss function inside the loop.

Quzah.