diff --git a/main.c b/main.c index 199acf9..f6e7abe 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,11 @@ #include +#include int main(int argc, char **argv) { - printf("Hello world!\n"); + char name[255]; + printf("Enter your name: "); + fgets(name, 255, stdin); + name[strlen(name)-1] = '\0'; /* remove the newline at the end */ + printf("Hello %s!\n", name); return 0; }