CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Default Function Argument

C++ quiz · Question 11
mediumFunctions

What is the output of this code?

Code

1#include <iostream>
2using namespace std;
3 
4void greet(string name = "World") {
5 cout << "Hello, " << name << "!" << endl;
6}
7 
8int main() {
9 greet();
10 greet("Alice");
11 return 0;
12}