#include#include #include void main() { char str1[100]; char str2[100]; printf("\nEnter the String 1 : "); gets(str1); strcpy(str2,str1); printf("nCopied String : %s",str2); getch(); } 
Output :
Enter the String 1 : c4learn Copied String : c4learn
Explain me ?
- Copy “str1″ into “str2″.
 - Result will be stored in “str2″
 - strcpy functions is included in Header File : string.h
 
Functions Required :

No comments:
Post a Comment