Saturday, July 27, 2019

string print the name

String print the name.


string print the name



// Include<string.h> including header file.

#include<stdio.h>
#include<conio.h>

void main()
{
char name1[20];
clrscr();
printf("Enter Your Name :-");
scanf("%s",&name1);


puts(name1);
getch();
}

Output:





print  the name with puts() and gets().

gets() and scanf() both are used to received input from the users.but gets() are show full string.

#include<stdio.h>
#include<conio.h>

void main()
{
char name1[20];
clrscr();
printf("Enter Your Name :-");
gets(name1);


puts(name1);
getch();
}

Output:














EmoticonEmoticon