Try this:
#include <stdio.h>
int main()
{
char str[50];
printf("Enter a string : ");
gets(str);
printf("You entered: %s", str);
return(0);
}
2
solved How to use the gets() command to take text input and display output using printf statement in c language? [closed]