Exam4Training

What is the output of the program?

What is the output of the program?

#include <iostream>

#include <string>

using namespace std;

int main()

{

string s1[]= {"Hello" , "World" };

for (int i=0; i<2; i++) {

cout << s1[i];

}

return( 0 );

}
A . It prints: HelloWorld
B.It prints: Hello
C.It prints: WorldHello
D.It prints: World

Answer: A

Exit mobile version