Result:Code:#include <stdio.h> char getInput(){ char temp; while(temp != EOF && (temp=getc(stdin)) != '\n'); temp = getc(stdin); return temp; } void main(){ char input; start: input = getInput(); printf("%c\n",input); goto start; }
I had to hit enter key twice the first time, but there is no problem on the succeeding input prompts. Why does this happen? Is there a way to fix this? Please, help me. What am I doing wrong?