As I add the code of remove newline, after input very long name it will show unhandled exception. How can I remove the newline and still get the benefit of fgets at the same time?Code:#include <stdio.h> #include <stdlib.h> int main() { char name[3], *line; printf("Name: "); fgets(name, sizeof(name), stdin); // Remove newline line = strchr(name,'\n'); *line = '\0'; printf("%s\n", name); printf("sssssssssssssss\n"); system("pause"); }