write a program to concatenate two string without using stract().
#include<stdio.h>
#include<conio.h>
int main()
{
char str1[50],str2[50],i,j;
printf("enter first string\n");
scanf("%s",&str1);
printf("enter second string\n");
scanf("%s",&str2);
for(i=0;str1[i]!='\0';i++);
for(j=0;str2[j]!='\0';j++,i++)
{
str1[i]=str2[j];
}
str1[i]='\0';
printf("\n output is %s",str1);
return 0;
}
Comments
Post a Comment