Program to concatenate two strings. (don’t use inbuilt function strcat() )
# include
# include
void main()
{
int i,j,k=0;
char str1[50],str2[50],str3[50];
clrscr();
printf("\nEnter a string: ");
scanf("%s",str1);
printf("\nEnter a string: ");
scanf("%s",str2);
for(i=0;str1[i]!='\0';i++)
{
str3[i]=str1[i];
}
for(j=i;str2[k]!='\0';j++)
{
str3[j]=str2[k];
k++;
}
for(i=0;i
getch();
}
/* Output
Enter a string: TOM
Enter a string: JERRY
TOMJERRY
*/
Shopping In MUMBAI
Are you searching for Discounts, offers, sale in Mumbai ? You are in the right place. MUMBAI, a shopping haven, has no dearth of great discounts and sales. This blog features the best MUMBAI shopping offers, sale, discounts and deals and bargains CURRENTLY GOING on in Mumbai plus a few free things thrown in on top.
Don't wait for it because once they are gone, they are gone. Hurry!..By clicking the "Like" button you will receive a daily update of discounts, sale, offers going on in Mumbai. LIKE IT.... SHARE IT...njoY.
Monday, December 29, 2008
C Program to concatenate two strings without using inbuilt function strcat()
Posted by ars at 11:57 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment