#include <string.h> #include <conio.h> #include <stdio.h> void main() { int i,j,len=0; char src[50],dest[50]; clrscr(); printf("\n Enter a String to Copy : " ); gets(src); for(i=0; src[i]!='\0'; i++) { dest[i]=src[i]; } dest[i]='\0'; printf("\n String is Successfully copied and it is : %s ",dest); free(src); getch(); }
OUTPUT:
Enter a String to Copy : Programming9 String is Successfully copied and it is : Programming9