10 Mar 2013

Concatenate two Strings

/*

Program to concatenate 2 strings...
  
*/

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
char a[200],b[200];
int c,d;
cout<<"Enter the first string:";
cin.getline(a,200);
cout<<endl<<"Enter the second string:";
cin.getline(b,200);
cout<<"Concatenated string is:";
for(c=0;a[c]!='\0';c++)
{
cout<<a[c];
}
cout<<'\t';
for(d=0;b[d]!='\0';d++)
{
cout<<b[d];
}
getch();
}

Categories: , ,

0 comments:

Post a Comment

Copyright © 2025 UPgradeCODING | Powered by Blogger