I want to test if a string which I read with fgets() is "new" or "repeat". If it is repeat, it works how it should, but if it is "new" it doesn't work. Anyone knows why?
char repeatornew[7];
fgets(repeatornew,7,stdin);
if(strcmp("repeat",repeatornew) == 0)
{
puts("repeat it.");
}
else
{
if(strcmp("new",repeatornew) == 0)
{
puts("new.");
}
else
{
printf("Please repeat the input! \n");
}
}