Use scanf to get the string in crefer to:lautturi.com
/*
Example:read a string using scanf function in C language
*/
#include <stdio.h>
int main()
{
char name[20];
printf("Enter name: ");
scanf("%s", name);
printf("Your name is %s.", name);
return 0;
}