C Programming
Computer Programming

C program to copies one string to another using strcpy() function



Write a program in C to copies one string to another string using strcpy() function

\* C program to copies one string to another using strcpy() function *\

# include < stdio.h >
# include < string.h >
int   main( )
{

char a[50], b[50] ;
printf ("\n Enter a source string : ") ;
scanf("%s", a ) ;
strcpy ( b, a ) ;
printf ("\n Copied string is = %s", b ) ;
return 0 ;

}

Output of Program :

Output of C program to copies one string to another using strcpy() function