-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblem_18.cpp
More file actions
32 lines (30 loc) · 860 Bytes
/
Copy pathproblem_18.cpp
File metadata and controls
32 lines (30 loc) · 860 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
#include<iostream>
using namespace std;
int main(){
cout<<"Enter your choice : 1. checking balance 2. deposit 3.withdrawal 4.Exit"<<endl;
int balance,depo_amount,with_amount,choice;
balance = 200;
cin>>choice;
if(choice==4){
cout<<"Exit";
}
else{
switch(choice){
case 1:cout<<"your current balance is : "<<balance;
break;
case 2:
cout<<"Enter deposit amount : "<<endl;
cin>>depo_amount;
cout<<"total amount is : "<<balance + depo_amount;
break;
case 3:
cout<<"Enter withdrawal amount : "<<endl;
cin>>with_amount;
cout<<"total amount is : "<<balance-with_amount;
break;
default:
cout<<"invalid number";
}
}
return 0;
}