Monday, 8 June 2015

Program that provides an example of functions with default arguments


Code for Program that provides an example of functions with default arguments in C++ Programming



 



 



 



#include<iostream.h>
#include<conio.h>
main()
{
    clrscr();
    void f(int=5,int=5);
    int i,j;
    f();
    i=10;
    j=20;
    f(i);
    f(i,j);
}

void f(int i,int j)
{
    cout<<"I= "<<i<<endl;
    cout<<"J= "<<j<<endl;
}
 

No comments:

Post a Comment