Take input of the string in C language by R4R Team


program-

include< stdio.h>
int main()
{
char c[20];
printf("Enter String \n");
scanf("%s",&c);
printf("Your String is %s",c);
}


output-

Enter String
Myprogramming
Your String is Myprogramming

Enter String
Mystring
Your String is Mystring


-In this program, when execution starts with main() function
-it will read char c[20], that means it is store a string of length 20.
-Then scanf("%s",c) are used to take input of the string.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!