Get a string Using gets() function
#include<stdio.h>
#include<conio.h>
void main()
{
char str[50];
printf("Enter a String:- ");
gets(str);
printf("You entered : %s", str);
getch();
}
Output:-
Enter a String:- hello
You entered : hello
#include<stdio.h>
#include<conio.h>
void main()
{
char str[50];
printf("Enter a String:- ");
gets(str);
printf("You entered : %s", str);
getch();
}
Output:-
Enter a String:- hello
You entered : hello
Comments
Post a Comment