top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

for(;c=getchar(),~c;) when condition will be false?

+1 vote
272 views
for(;c=getchar(),~c;) when condition will be false?
posted May 20, 2016 by Rajan Paswan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Hi rajan,

This wont be false,It is in finite loop. If that variable c is 4 nibble then we can make this condition false. Because getchar read only one character form the terminal so we what ever char you enter that variable wont be false.

Happy Learning :)

answer May 23, 2016 by Jaganathan
Similar Questions
+1 vote

My code compiles even without inclusion of stdio.h, any suggestion on best practices?

+3 votes

1.

main()
{
printf("%x",-1<<4);
}

2.

main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
}
...