C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 15 Topic 2 Discussion

C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 15 Topic 2 Discussion

CPA-21-02 Exam Topic 2 Question 15 Discussion:
Question #: 15
Topic #: 2

What is the output of the program?

#include

#include

using namespace std;

int main()

{

string s1[]= {"H" , "t" };

string s;

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

s = s1[i];

s.insert(1,"ow");

cout << s;

}

return( 0 );

}


A.

It prints: How


B.

It prints: Ht


C.

It prints: Hoto


D.

It prints: Howtow


Get Premium CPA-21-02 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.