Radical Developers welcomes all the visitors to be a member of the team. Come join us. Its all about open-source concept. All Programs are written and tested in MacOS X, Unix, Linux and may not match with the outputs of Turbo C++ in Windows

Sunday, January 9, 2011

Write a program to combine two strings using strcat().


Source Code :

#include<stdio.h>
void main()
{
      char str1[20],str2[20];
      clrscr();
      printf("\nEnter 1st String : ");
      gets(str1);
      printf("\nEnter 2nd String : ");
      gets(str2);
      strcat(str1,str2);
      printf("\nConcatenated String : %s",str1);
      getch();
}

Output :

Enter 1st String : Cat

Enter 2nd String : Dog

Concatenated String : CatDog

No comments:

Post a Comment