/*C++ program to demonstrate example of Default Argument.*/
using namespace std;
//Default argument must be trailer.
int sum(int x, int y=10, int z=20)
cout << "Sum is : " << sum(5) << endl;
cout << "Sum is : " << sum(5,15) << endl;
cout << "Sum is : " << sum(5,15,25) << endl;
Sum is : 35
Sum is : 40
Sum is : 45
total answers (1)
start bookmarking useful questions and collections and save it into your
own study-lists, login now to start creating your own collections.