CPA practice question 7 of 30

Which code, inserted at line 10, generates the output "Hello World"? #include #include using namespace std; string fun(string, string); int main() { string s="Hello"; string *ps; ps = &s; //insert code here return 0; } string fun(string s1, string s2) { return s1+s2; }

Full set: 220 questions
Answer options
A: cout << fun(" World");
B: cout << fun(*ps);
C: cout << fun("Hello");
D: cout << fun("Hello", " World"); Correct answer
Correct Answer:
D. cout
Scroll to Top