I am writing a guessing game, player could only enter number ten times, after that, a "End" message should print.
the random name =ran1
your enter number = a
count the enter times = b
I wrote :
if ( ran1 != a)
{
b++;
}
printf("the count number: %d", b);
printf("\nthat's the end.");
but it doesn't work, the count number is still zero!!!!
however, I wrote :
if ( ran1 == a)
{
b++;
}
printf("the count number: %d", b);
printf("\nthat's the end.");
it works, the count number is can change!!!!!
what's the problem?