Home » C++ Programming » Strings » Question
  1. What is the output of this program?
    #include <iostream>
    #include <cstring>
    using namespace std;
    int main ()
    {
    char s1[10] = "Interview";
    char s2[10] = "Mania";
    char s3[10];
    int length ;
    strcpy( s3, s1);
    strcat( s1, s2);
    length = strlen(s1);
    cout << length << endl;
    return 0;
    }
    1. Interview
    2. Mania
    3. Interview Mania
    4. 14
    5. None of these
Correct Option: D

In the program, We are concatenating the s1 and s2 and printing it’s total length. So the length is 14.



Your comments will be displayed only after manual approval.