jeudi 14 mars 2019

Loop asking for input every second entry instead of every time [duplicate]

This question already has an answer here:

As the title says, and I can't figure out why this is happening. It's probably something obvious, too.

void main()
{
    char input = 0;
    int i = 0, num1 = 0, num2 = 0;

    for (i = 0; i <= 9; i++) {
        scanf_s("%c", &input);
        if (input >= 'a')
        {
            num1++;
        }
        else if (input == 'H')
        {
            num2++;
        }

    }
    printf("%d lowercase, %d  \"H\".", br1, br2);
}

Aucun commentaire:

Enregistrer un commentaire