SIMPLE INTEREST C++ program

by - December 19, 2018

/*WRITE A PROGRAM TO FIND SIMPLE INTEREST USING DEFAULT ARGUMENT*/
       
 #include<iostream.h>
#include<conio.h>
#include<stdio.h>
float interest(intp,intt,float r=0.15)
{
 return (p*t*0.15);
}
void main()
{
 clrscr();
 int p, t, inter;
 cout<<"Enter the principle";
 cin>>p;
 cout<<"Enter the time period in year";
 cin>>t;
 inter=interest(p,t);
 cout<<"The interest is"<<inter;
 getch();
}

----------------------------------------------------------
OUTPUT:-

You May Also Like

0 comments