jeudi 21 décembre 2017

after getch() the program ignores the if even after putting 1-6.

I have a problem with my code. It always ignoring the if(userDigit<=6 && userDigit>=1).. Can someone tell me what is wrong here?

        for(i=0; i<4; i++)
        {
            userDigit=getch();
            putch(userDigit);

            if(userDigit<=6 && userDigit>=1)
            {
                //code              
            }
            else
            {
               correct=0;
            }                       
        }

        if(correct == 0)
        {
            printf("wrong");
            correct++;
        }

Aucun commentaire:

Enregistrer un commentaire