I/O in c without printf and scanf.
Problem
I/O in c without printf and scanf.
Method 1 - getchar and putchar
int getchar();
int putchar(int value);
Sample Program
#include <stdio .h> int main(void) { int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } Note the use of parentheses. c=gethar()!=EOF implies whether c = 0 or 1 depending on whether character get is not EOF or is EOF. EOF is 257 , so use int rather than char.
[Read More]