Answer:
/*include I/O function for compiler to check*/
#include <stdio.h>
int main(void){
int c;
for ( ; ; ){ /*infinite loop*/
c = getchar(); /*read a next single character from stdin*/
if(c == EOF) /*EOF (end-of-file) is global constant, which is defined in stdio.h */
break; /*if end-of-file, break out of the loop*/
putchar(c); /*else, write a single character to stdout*/
}
return 0;
}
Output:
There are many other ways to do it
No Response to "Question 1"
Post a Comment