DEV Community

Mehfila A Parkkulthil
Mehfila A Parkkulthil

Posted on

Day 11 : C++ Language | String Concatenation | Part -2

String Concatenation

It is the adding of 2 or more strings, which are connected using + sign.


#include<iostream>
#include<string>
using namespace std;
 int main(){
   string age = "23";
   string  name = "Aiera" ;
   string person = name + age;

   cout << person;
   return 0;
}



// output : Aiera23

Enter fullscreen mode Exit fullscreen mode

#include<iostream>
#include<string>
using namespace std;
 int main(){
   string age = "23";
   string  name = "Aiera" ;
   string person = name + " " + age;

   cout << person;
   return 0;
}



// output : Aiera 23

Enter fullscreen mode Exit fullscreen mode

Previous Blogs

Top comments (0)