-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
atm.c
67 lines (64 loc) · 1.89 KB
/
atm.c
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<stdio.h>
int main()
{
int pass=2584, bal=20000, entry, usrpass, usrch, usrbal, ip;
//Password is 2584//
printf("--------------------------------\n");
printf("\tInsert Your Card");
printf("\nPress 1 to Confirm Card Entry.\n");
printf("--------------------------------");
printf("\nType Confirmation : ");
scanf("%d", & entry);
if (entry==1){
printf("\nCard Accepted Successfully.");
printf("\n--------------------------------");
printf("\nEnter Your Password : ");
scanf("%d",&usrpass);
if(usrpass==pass){
printf("--------------------------------");
printf("\n\tWelcome to SBI\n");
printf("\n1)Withdraw\t2)Check Balance");
printf("\n--------------------------------");
printf("\nEnter Your Choice : ");
scanf("%d",&usrch);
printf("--------------------------------");
switch(usrch){
case 1:
printf("\nAvailable Notes : 100 \t200");
printf("\n 500 \t2000");
printf("\n--------------------------------");
printf("\nEnter Your Amount : ");
scanf("%d",&usrbal);
if(usrbal>bal){
printf("\n--------------------------------");
printf("\nInsufficiant Balance.");
}
else{
printf("--------------------------------");
printf("\nTransection Successful....");
bal=(bal-usrbal);
printf("\n--------------------------------");
//Note Calculation Part//
printf("\n No. of 2000 note : %d",usrbal/2000);
usrbal=usrbal%2000;
printf("\n No. of 500 note : %d",usrbal/500);
usrbal=usrbal%500;
printf("\n No. of 200 note : %d",usrbal/200);
usrbal=usrbal%200;
printf("\n No. of 100 note : %d",usrbal/100);
usrbal=usrbal%100;
}
break;
case 2:
printf("\nYour Account Balance is %d",bal);
break;
default:
printf("\nWrong Input");
break;
}
}
}
else{
printf("You Had not Inserted Your Card\n");
}
}