getchar() not working in c
问题 getchar() is not working in the below program, can anyone help me to solve this out. I tried scanf() function in place of getchar() then also it is not working. I am not able to figure out the root cause of the issue, can anyone please help me. #include<stdio.h> int main() { int x, n=0, p=0,z=0,i=0; char ch; do { printf("\nEnter a number : "); scanf("%d",&x); if (x<0) n++; else if (x>0) p++; else z++; printf("\nAny more number want to enter : Y , N ? "); ch = getchar(); i++; }while(ch=='y'|