-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminimumnotes.cpp
More file actions
68 lines (60 loc) · 1.37 KB
/
minimumnotes.cpp
File metadata and controls
68 lines (60 loc) · 1.37 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include<iostream>
using namespace std;
int main()
{
int amount;
int rs1, rs2000, rs5, rs10, rs20, rs50, rs100, rs500;
cout<<"This is a simple Program to calculate the number of notes required"<<endl;
rs1 = rs5 = rs10 = rs20 = rs50 = rs100 = rs500 = rs2000 = 0;
cout << "\nEnter the amount :- ";
cin >> amount;
if(amount >= 2000)
{
rs2000 = amount/2000;
amount -= rs2000 * 2000;
}
if(amount >= 500)
{
rs500 = amount/500;
amount -= rs500 * 500;
}
if(amount >= 100)
{
rs100 = amount/100;
amount -= rs100 * 100;
}
if(amount >= 50)
{
rs50 = amount/50;
amount -= rs50 * 50;
}
if(amount >= 20)
{
rs20 = amount/20;
amount -= rs20 * 20;
}
if(amount >= 10)
{
rs10 = amount/10;
amount -= rs10 * 10;
}
if(amount >= 5)
{
rs5 = amount/5;
amount -= rs5 * 5;
}
if(amount >= 1)
{
rs1 = amount;
}
cout << "\nTotal number of Notes" <<endl;
cout << "RS 2000 = " << rs2000 <<endl;
cout << "RS 500 = " << rs500 <<endl;
cout << "RS 100 = " << rs100 <<endl;
cout << "RS 50 = " << rs50 <<endl;
cout << "RS 20 = " << rs20 <<endl;
cout << "RS 10 = " << rs10 <<endl;
cout << "RS 5 = " << rs5 <<endl;
cout << "RS 1 = " << rs1 <<endl;
return 0;
}