Input from keyboard and output to the console :-
First open Linux Terminal > (write) gedit filename.c > (press enter)
int main() { char buf[50]; int n = read(0,buf,50); write(1,buf,50/n); }
Save the file .
How to compile and run :-
Open Linux Terminal > (write ) gcc filename.c > (press enter)
> (write) ./a.out > (press enter)
Syntax explanation :-
read( int fd , void *buf ,int size)
file descriptors :
0 – Input from the keyboard.
1 – Output to the console.