summaryrefslogtreecommitdiff
path: root/echo.c
diff options
context:
space:
mode:
authormartin@ashbysoft.com <martin@ashbysoft.com>2022-06-11 20:02:48 +0000
committermartin@ashbysoft.com <martin@ashbysoft.com>2022-06-11 20:02:48 +0000
commitc813f7bd522baf1057ba9bee874669ea5b945a66 (patch)
treedfb3c1dc231ad779cd693d3890bd154839ea5121 /echo.c
parent9688990db4ce2078a0027315ca80b5717fc5cacd (diff)
downloadlearn-c-c813f7bd522baf1057ba9bee874669ea5b945a66.tar.gz
learn-c-c813f7bd522baf1057ba9bee874669ea5b945a66.tar.bz2
learn-c-c813f7bd522baf1057ba9bee874669ea5b945a66.tar.xz
learn-c-c813f7bd522baf1057ba9bee874669ea5b945a66.zip
more intro exercises
Diffstat (limited to 'echo.c')
-rw-r--r--echo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/echo.c b/echo.c
new file mode 100644
index 0000000..bf590a5
--- /dev/null
+++ b/echo.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int main(void) {
+ int c;
+ while ((c = getchar()) != EOF) {
+ putchar(c);
+ }
+ return 0;
+} \ No newline at end of file