"Hello World!" in C

  • + 1 comment

    scanf("%[^\n]%*c", &s);

    [^\n]-prints whole string for example in "hello guys" only hello will be printed but after [^\n] whole string will be printed considering space.