-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathswitch.cpp
More file actions
67 lines (49 loc) · 1.46 KB
/
Copy pathswitch.cpp
File metadata and controls
67 lines (49 loc) · 1.46 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
#include <iostream>
using namespace std;
int main(){
// int a,b;
// cout<<"Enter the value of a: "<<endl;
// cin>>a;
// cout<<"Enter the value of b: "<<endl;
// cin>>b;
// char op;
// cout<<"Enter the operation: "<<endl;
// cin>>op;
// switch (op)
// {
// case '+': cout<< (a+b) << endl;
// break;
// case '-': cout<< (a-b) << endl;
// break;
// case '*': cout<< (a*b) << endl;
// break;
// case '/': cout<< (a/b) << endl;
// break;
// case '%': cout<< (a%b) << endl;
// break;
// default: cout<< "Please enter a valid operation"<<endl;
// break;
// }
//homework
int amount ;
cout<<"Enter the amount: "<< endl;
cin>>amount;
int hun_notes;
int fif_notes;
int twenty_notes;
int one_notes;
switch(1){
case 1: hun_notes = amount/100;
amount = amount - 100*hun_notes;
case 2: fif_notes = amount/50;
amount = amount - 50*fif_notes;
case 3: twenty_notes = amount/20;
amount = amount - 20*twenty_notes;
case 4: one_notes = amount/1;
amount = amount - 1*one_notes;
}
cout<< "No of hundred notes req in amount:"<<hun_notes<<endl;
cout<< "No of fifty notes req in amount:"<<fif_notes<<endl;
cout<< "No of twenty notes req in amount:"<<twenty_notes<<endl;
cout<< "No of one notes req in amount:"<<one_notes<<endl;
}