-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSI.cpp
More file actions
39 lines (34 loc) · 688 Bytes
/
SI.cpp
File metadata and controls
39 lines (34 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<iostream>
using namespace std;
class interest{
public:
int principal;
int rate;
int time;
public:
int si(int p,int t,int r)
{
printf("SI=%d",(p*r*t)/100);
}
};
int main(){
interest obj;
cout<<"Enter the rate = ";
cin>>obj.rate;
cout<<"Enter the time = ";
cin>>obj.time;
cout<<"Enter the principal = ";
cin>>obj.principal;
obj.si(obj.principal,obj.rate,obj.time);
//OR
/*int r,t,p,s;
cout<<"Enter the rate = ";
cin>>r;
cout<<"Enter the time = ";
cin>>t;
cout<<"Enter the principal = ";
cin>>p;
s = (p*r*t)/100;
cout<<"The simple interest = "<<s;*/
return 0;
}