Search



Wednesday, 4 March 2015

Copy a String using strcpy

#include <stdio.h>
#include<conio.h>
#include<string.h>
void  main()
{   int i;
char s1[100], s2[100];
clrscr();
printf("\n\n program to copy string using strcpy");
printf("\n Enter string s1: ");
scanf("%s",s1);
strcpy(s2,s1);
printf("\n String s2: %s",s2);
getch();
}

No comments:

Post a Comment

Guys if you think something is wrong or should be edit than please do comment.