HOME

Sunday, November 29, 2015

DEFAULT ARGUMENT

#include<iostream>
using namespace std;
int interest(int , int,int r=5);
int main()
{
    int p,t;
    cout<<"Enter principle and time "<<endl;
    cin>>p>>t;
    interest(p,t);
    return 0;
}
int interest(int p, int t, int r)
{
    int si=(p*t*r)/100;
    cout<<"Simple Interest is "<<si<<endl;
return 0;
}

No comments:

Post a Comment