#include<stdio.h>
#include<string.h>intmain(){chars1[20]="Hello, World!";chars2[20];printf("———————————————————————————————————————————");printf("\nProgram to copy the given string");printf("\n———————————————————————————————————————————");printf("\nInput string %s ",s1);strcpy(s2,s1);printf("\n\nThe copied string is %s ",s2);printf("\n———————————————————————————————————————————\n");return0;}
Output
kodingwindow@kw:~$ gcc kw.c kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to copy the given string
———————————————————————————————————————————
Input string Hello, World!
The copied string is Hello, World!
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.