-
Notifications
You must be signed in to change notification settings - Fork 0
/
atm.c
105 lines (102 loc) · 2.46 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//Mishra ATM Services
#include<stdio.h>
#include<time.h>
void main()
{
int cnum=123,pass=123,count=0;
int cnumber,choice;
char exit;
int balance=125634;
static amount=0;
static spass=123;
time_t tm;
time(&tm);
do{
printf("~~~~~Welcome to Mishra's ATM Prayagraj~~~~~\n");
step1:;
printf("\nEnter Your Card Number:\n");
scanf("%d",&cnumber);
if(cnumber==cnum)
{
count++;
step2:;
printf("Enter Password:\n");
scanf("%d",&pass);
if(pass==spass)
{
system("cls");
printf("1.Enter 1 For Check Balance:\n");
printf("2.Enter 2 For Mini Statement Balance:\n");
printf("3.Enter 3 For Account Deatails:\n");
printf("4.Enter 4 For Cash Withdrawl:\n");
printf("5.Enter 5 For Change Password:\n");
printf("6.Enter 6 for Exit.\n");
printf("Enter choice:\n");
scanf("%d",&choice);
switch(choice)
{
case 1:
system("cls");
printf("Your Balance is:%d\n",balance-amount);
break;
case 2:
system("cls");
printf("~~Mishra's Bank Civil Lines Prayagraj\n~~\n\n");
printf("Date:%s\n",ctime(&tm));
printf("Your Balance is:%d\n",balance);
printf("You Enter %d times card in atm.\n",count);
printf("Account Holder Name:Suraj Mishra\n");
break;
case 3:
system("cls");
printf("Date:%s\n",ctime(&tm));
printf("Account Type:Saving\n");
printf("Account Holder Name:Suraj Mishra\n");
printf("Account Opening Date is:10/10/2016 \n");
printf("Branch Name is:Mishra's Bank Civil Lines Prayagraj\n");
printf("Nommene Name is:Anand Kumar Mishra\n");
break;
case 4:
system("cls");
printf("~~Mishra's Bank Civil Lines Prayagraj\n~~\n\n");
printf("Enter Your Cash Amount for Withdrawl:\n");
scanf("%d",&amount);
printf("\nCash Withdrawl Successfully");
break;
case 5:
system("cls");
printf("~~Mishra's Bank Civil Lines Prayagraj\n~~");
printf("Enter Your New Password:\n");
scanf("%d",&spass);
printf("Password Change Successfully/n");
break;
case 6:
goto step3;
default:
printf("Sorry!! Invalid Option");
break;
}
}
else
{
printf("\nIncorrect Password\n");
goto step2;
}
}
else
{
printf("ohh--! Incorrect Card Number. Enter Again.\n");
count++;
goto step1;
}
step3:;
printf("\nDo You Want to Cancel Banking [y/n]:");
fflush(stdin);
scanf("%c",&exit);
system("cls");
if(exit=='y')
{
printf("Thank You For Visiting Mishra's Bank ATM. ");
}
}while(exit=='n');
}