//WAP TO COPY A STRING.
//WITHOUT USING LIABRARY FUNCTION
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char A[20],b[20];
int i;
clrscr();
puts("\nENTER THE STRING:");
gets(A);
puts("\n\nENTERED STRING IS");
puts("\n\n");
puts(A);
for(i=0;A[i]!='\0';i++)
b[i]=A[i];
b[i]='\0';
printf("\n\nAFTER COPYING STRING IS:%s",b);
getch();
}
/*---------------------------------------------------------
OUTPUT
-----------------------------------------------------------
ENTER THE STRING:
ABHISHEK WADHWA
ENTERED STRING IS
ABHISHEK WADHWA
AFTER COPYING STRING IS:ABHISHEK WADHWA
*/
No comments:
Post a Comment