So like what the title suggest i have tried to use putchar()
to print a result of a not equal to test !=
but the output i got is a question mark.
Here is the code:
#include <stdio.h>
main()
{
int c;
c = getchar() != EOF;
putchar(c);
}
I have used printf()
and it works:
#include <stdio.h>
main()
{
printf("%d",getchar()!=EOF);
}
My question is: Why it doesn't work with putchar
?