So I'm trying to concatenate two strings but in the output the second string appears on the next line. I want them to be on the same line.
#include <string.h>
#include <stdio.h>
int main()
{
char str1[50], str2[50];
fgets(str1, sizeof(str1), stdin);
fgets(str2, sizeof(str2), stdin);
strcat(str1, str2);
printf("%s", str1);
return 0;
}
`