Code:
#include <iostream>
#include <string>
using namespace std;
int main() {
string s1,s2,s3;
cout<<"Enter first name : ";
cin>>s1;
cout<<"Enter last name : ";
cin>>s2;
s3=s1+s2;
cout<<"Full Name : "<<s3;
}
Input:
Enter first name : muhammad
Enter last name : abbas
Full Name : muhammadabbas
So, you can see how we can add two names first and last.
0 Comments