#include <iostream.h>
#include <conio.h>
void main()
{
char s1[20], s2[20], target[40];
cout<<"\n Enter 1st String:";
cin.getline(s1,20);
cout<<"\n Enter 2nd String:";
cin.getline(s2,20);
iny k = 0;
/* First string into the target */
for(int i = 0; s1[i]!='\0';i++,k++)
target[k] = s1[i];
/* Append second string into target */
for(i = 0; s2[i]!='\0';i++,k++)
target[k] = s2[i];
clrscr();
cout<<"\n The Firstly Entered String = "<< s 1;
cout<<"\n Next Entered String = "<< s 2;
cout<<"\n\n The Output String = "<< target;
getch();
}
No comments:
Post a Comment