It reads everything typed at the keyboard until the Enter key is pressed.
#include
int main(){
char name[20];
printf("Name:");
gets(name);
printf("%s \n",name);
return(0);
}
Name:1
1
gets(var) is the same as scanf("%s",var).