086. Write a program to copy a string into another string in C language

#include<stdio.h>
#include<conio.h>
main()
{
	int i;
	char *s1,*s2;
	clrscr();
	printf("Enter the string 1....");
	scanf("%s",s1);
	for(i=0;s1[i]!='\0';i++)
	{
		s2[i]=s1[i];
	}
	s2[i]='\0';
	printf("The copied string is...%s",s2);
	getch();
}

Leave a Reply

Your email address will not be published. Required fields are marked *