C++ Default Value for Parameters

#include<iostream>
using namespace std;
void anik(int a = 10, int b = 20)
{
    cout << a << endl;
    cout << b << endl;
    int sum = a + b;
    cout << "Summation is :: " << sum << endl << endl;

}

int main()
{
    anik();

    anik(14);

    anik(30, 20);

    return 0;
}

Comments