it is used to get or scan string from user.it will terminate when user press Enter key.white space is also allowed in string.
SYNTAX: gets(variable);
Example:
#include<stdio.h>
#include<conio.h>
main()
{
char name[100];
clrscr();
printf("Enter Your Name: ");
gets(name);
printf("\nYour name is %s",name);
getch();
}
SYNTAX: gets(variable);
Example:
#include<stdio.h>
#include<conio.h>
main()
{
char name[100];
clrscr();
printf("Enter Your Name: ");
gets(name);
printf("\nYour name is %s",name);
getch();
}