Repeats input to end of file with getchar() and putchar() - C Data Type

C examples for Data Type:char

Description

Repeats input to end of file with getchar() and putchar()

Demo Code

#include <stdio.h>
int main(void)
{
    int ch;/*from   w  w w  .j  a v a  2 s  .com*/
    
    while ((ch = getchar()) != EOF)
        putchar(ch);
    
    return 0;
}

Result


Related Tutorials