"Hello World!" in C

  • + 1 comment

    Why is this wrong? The expected output is identical to what I'm getting.

    int main() 
    {
        char s[100];
        fgets(s, sizeof(s), stdin);
        
        printf("Hello World!\n%s", s);
        return 0;
    }