Call function without argument Call function with argument = 5
Value = 10 Value = 5
int multiply(int a, int b = 2) { // b has default value 2
return a * b;
}
void function_q10_default_args() {
cout << "10 * 2 (default): " << multiply(10) << endl;
cout << "10 * 5 (custom): " << multiply(10, 5) << endl;
}
int multiply(int a, int b = 2) { // b has default value 2
return a * b;
}
void function_q10_default_args() {
cout << "10 * 2 (default): " << multiply(10) << endl;
cout << "10 * 5 (custom): " << multiply(10, 5) << endl;
}