On May 3, 1:27 pm, Krishna <tkmal...@gmail.com> wrote:
> Hi,
>
> I missed one of the parenthesis in the following code and got the
> following result, I am not able to figure it out can any one explain.
> Thanks
>
> mian(void){
> int c;
> while(c=getchar()!=EOF)
> putchar(c);
>
> }
>
> Result: (Entered 1)
> 1
> ??
Operator precedence: '!=' has precedence over '='
c=getchar()!=EOF is eauavilent to:
int x = (getchar() != EOF);
c = x;