Tuesday, 5 April 2016

Program to concatenate strings C++ Problem Solution.


Solution:

#include<bits/stdc++.h>
using namespace std;
/*
    *
    * Prosen Ghosh
    * American International University - Bangladesh (AIUB)
    *
*/
int main(){

    string first,second;

    cout << "Enter first string: ";
    getline(cin,first);
    cout << "Enter first string: ";
    getline(cin,second);
    first += " ";
    for(int i = 0; i < second.size(); i++)first += second[i];

    cout << "The First String After Adding Second String Content Is:\n" << first << endl;
    return 0;
}

No comments:

Post a Comment