C Program To Copy One Character Array Into Another

How to write a C Program To Copy One Character Array Into Another in C Programming Language ?

Solution For C Program :

/*C Program To Copy One Character Array Into Another.*/

#include<stdio.h>
void main()
{
char str1[81], str2[81];
int k = 0;
printf("\nEnter Any Data : ");
scanf("%s", str1);
printf ("\nProcessing The String : ");
for (k = 0; str1[k] != '\0'; k++)
str2[k] = str1[k];
str2[k] = '\0' ;
printf ("\nThe Two Stings Are :\n%s \t %s", str1, str2);
}


You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable


Learn More :