-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberOfNotes.cpp
More file actions
44 lines (36 loc) · 856 Bytes
/
NumberOfNotes.cpp
File metadata and controls
44 lines (36 loc) · 856 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
40
41
42
43
44
#include <iostream>
using namespace std;
int main()
{
int amount, deno = 0;
cout << "Enter the Total Amount: ";
cin >> amount;
int count100 = 0, count50 = 0, count20 = 0, count10 = 0;
if(amount >= 100){
deno = 100;
}
else if(amount >= 50){
deno = 50;
}
else if(amount >= 20){
deno = 20;
}
else if(amount >= 10){
deno = 10;
}
switch(deno) {
case 100 : count100 = amount / 100;
amount %= 100;
case 50 : count50 = amount / 50;
amount %= 50;
case 20 : count20 = amount / 20;
amount %= 20;
case 10 : count10 = amount / 10;
amount %= 10;
}
cout << "No. of 100 notes: " << count100 << endl;
cout << "No. of 50 notes: " << count50 << endl;
cout << "No. of 20 notes: " << count20 << endl;
cout << "No. of 10 notes: " << count10 << endl;
return 0;
}