Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
char str1[10] = "Hello";
7.
char str2[10] = "World";
8.
char str3[10];
9.
int len ;
10.
strcpy( str3, str1);
11.
strcat( str1, str2)
12.
len = strlen(str1);
13.
cout
Options:
A .  5
B .  55
C .  11
D .  10
Answer: Option D

In the program, We are concatanating the str1 and str2 and printing
it’s total length. So the length is 10.
Output:
$ g++ stri.cpp
$ a.out
10



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers