#include <stdio.h>
#include <string.h>
void main()
{
char str1[50], str2[50];
clrscr();
printf("\n enter first string:");
gets(str1);
printf("\n enter second string:");
gets(str2);
printf("\n Before Copy String s1 is: %s",str1);
strcpy(str1,str2);
printf("\n After Copy String s1 is: %s", str1);
getch();
}
#include <string.h>
void main()
{
char str1[50], str2[50];
clrscr();
printf("\n enter first string:");
gets(str1);
printf("\n enter second string:");
gets(str2);
printf("\n Before Copy String s1 is: %s",str1);
strcpy(str1,str2);
printf("\n After Copy String s1 is: %s", str1);
getch();
}
Copy String |
No comments:
Post a Comment