echo.c
279 Bytes
#include <stdio.h>
#include <string.h>
int main(void) {
printf("Input a string\n");
printf("Will exit on input \"exit\"\n");
while (1) {
char str[50];
scanf("%s", str);
if (strcmp(str, "exit") == 0) {
break;
} else {
printf("%s\n", str);
}
}
return 0;
}