fgets how to remove new-line character code example
Example 1: how to remove \n from a string c
str[strcspn(str, "\n")] = 0;
Example 2: remove \n from string c
strtok(Name, "\n");
Example 3: fgets remove newline
strtok(in, "\n");
str[strcspn(str, "\n")] = 0;
strtok(Name, "\n");
strtok(in, "\n");