Program
#include <stdio.h> #include<string.h> int main() { char str1[20],str2[20],str3[40]; int len; printf("************************************************************"); printf("\n************************************************************"); printf("\n** WAP to concatenate one string into another string **"); printf("\n** Created by Sheetal Garg **"); printf("\n** Assistant Professor **"); printf("\n** Phone No:9467863365 **"); printf("\n************************************************************"); printf("\n************************************************************"); printf("\nenter the string1\n"); gets(str1); printf("\nenter the string2\n"); gets(str2); strcpy(str3,str1); strcat(str3,str2); printf("\nConcatenated string is %s", str3); }
Output 1
************************************************************ ************************************************************ ** WAP to concatenate one string into another string ** ** Created by Sheetal Garg ** ** Assistant Professor ** ** Phone No:9467863365 ** ************************************************************ ************************************************************ enter the string1 Sheetal enter the string2 Garg Concatenated string is SheetalGarg