Social Icons

Sunday, 23 March 2014

C Program to copy a string

#include<stdio.h>
#include<conio.h>
main()
{
char ch[30],ch1[30];
int i;
clrscr();
printf("\n Enter a string : ");
gets(ch);
for(i=0;ch[i]!='\0';i++)
ch1[i]=ch[i];
printf("\n The copied string is : %s",ch1);
getch();
}


                                                     OUTPUT

No comments:

Post a Comment