The gets() allows the user to enter the space-separated strings. It returns the string entered by the user.
gets():
puts():
#include<stdio.h>
void main ()
{
char s[30];
printf("Enter the string? ");
gets(s);
printf("You entered %s",s);
}
Enter the string? aimtocode is the best You entered aimtocode is the best
#include <stdio.h>
#include <conio.h>
void main( ) {
char name[20];
printf( "Enter your name : ");
gets(name);
printf( "Your name is : ");
puts(name);
getch ();
}
Enter your name : Your name is : Prayag