belongs to collection: C++ language string programs
I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.
#include <iostream> #include <cstring> using namespace std; int main() { char s1[50], s2[50], result[100]; cout << "Enter string s1: "; cin.getline(s1, 50); // Reading first string from user cout << "Enter string s2: "; cin.getline(s2, 50); // Reading second string from user strcat(s1, s2); // strcat is use to Concatenates two strings cout << "String obtained on concatenation is:" << s1 << endl; return 0; }
Result:
Enter string s1: tech
Enter string s2: study
String obtained on concatenation is:techstudy
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
I have used CodeBlocks compiler for debugging purpose. But you can use any C++ programming language compiler as per your availability.
Result:
Enter string s1: tech
Enter string s2: study
String obtained on concatenation is:techstudy
need an explanation for this answer? contact us directly to get an explanation for this answer