-->

Facebook

Jasper Roberts - Blog

Wednesday, April 8, 2015

Write a C program to copy one string to another string.

#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();
}
Write a C program to copy one string to another string.
Copy String

No comments:

Post a Comment