my counter does not seem to increment (for c programming)
int ch;
int counterX = 0;
int counterY = 0;
while(( ch = getchar()) != EOF ) {
if (ch == 'X'){
counterX = counterX + 1;
}
if (ch == 'Y'){
counterY = counterY + 1;
}
}
ive done some testing and I the number for counterX and counterY doesnt seem to increase, regardless of my input. Please help!