A.
//Copy one string into another string
#include<stdio.h>
#include<conio.h>
void main()
{
char string[100];
char copystring[100];
int len=0,i=0;
printf("Enter the string to copy");
gets(string);
while(string[i]!='\0')
{
len++;
i++;
}
len--;
i--;
for(i=0; i<=len; i++)
{
copystring[i]=string[i];
}
printf("\nCopied string is\n");
for(i=0; i<=len; i++)
{
printf("%c", copystring[i]);
}
getch();
}
B.
// C Program to Append two strings
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char str1[100];
char str2[100];
int len=0,i=0;
printf("Enter First string:");
gets(str1);
printf("Enter Second string:");
gets(str2);
strcat(str1,str2);
while(str1[i]!='\0')
{
len++;
i++;
} len--; i--;
printf("\nAppended string is\n");
for(i=0; i<=len; i++)
{
printf("%c", str1[i]);
}
getch();
}