You are on page 1of 3

1. #include<stdio.

h>
2. #include<conio.h>
3. char x;
4. int pin, repeat, menu;
5. int withdraw, deposit, transfer, amount;
6. main()
7.
8.
9. { clrscr();
10. gotoxy(20,1);printf(":--------------------------------------:\n");
11. gotoxy(20,2);printf(": Welcome to ATM Banking System:\n");
12. gotoxy(20,3);printf(": Created by:\n");
13. gotoxy(20,4);printf(": Computer science students:\n");
14. gotoxy(20,5);printf(": :\n");
15. gotoxy(20,6);printf(": Enter your PIN -->:\n");
16. gotoxy(20,7);printf(":--------------------------------------:\n");
17. gotoxy(40,6);
18. scanf(" %d",&pin);
19. if (pin==1234)
20. {printf("access granted");}
21. else
22. {exit();}
23. Loop:
24.
25.
26. {clrscr();
27. printf(":-------------------------------------------:\n");
28. printf(": Choose your Transaction :\n");
29. printf("::\n");
30. printf(": 1 Inquiry Balance :\n");
31. printf(": 2 Withdraw:\n");
32. printf(": 3 Deposit :\n");
33. printf(": 4 Transfer Fund:\n");
34. printf(": 5 Exit:\n");
35. printf(": -->:\n");
36. printf(":-------------------------------------------:\n");
37. gotoxy(6,9);
38. scanf(" %d",&menu);
39. printf("\n\n");
40. switch(menu)
41.
42.
43. {
44. case 1:{printf("Your balance %d\n\n",amount);
45. printf("Another transaction? y or n?: ");
46. scanf(" %c",&x);
47. if((x == 'y')||(x== 'Y'))
48.
49.
50. {
51. goto Loop;
52. }
53. else if((x =='n')||(x== 'N'))
54.
55.
56. {
57. printf("\nThank You for Banking");
58. getch();
59. exit();
60. }

else if ((x =='n')||(x=='N')) 84. 93. printf("Enter Amount to Withdraw: "). 95. 73. 82. { 70.amount). getch().&withdraw). 77. 75. printf("\nThank You for Banking"). printf("\nYour Current Balance %d".amount). scanf(" %d". scanf("%d". 120. } } 91. 112. 90.&transfer). 97. 101.&x). printf("\nEnter Amount to Transfer: ").amount). 111. goto Loop. 99. case 2:{if(amount==0) 63. } 83. goto Loop. printf("Another Transaction? y or n : "). printf("\n\nThank You for Banking"). 80. 94. 76. break. amount = amount . 61. scanf("%d". printf("\nEnter Amount to Deposit: "). getch(). } 67. case 3:{printf("Your Balance %d\n". . printf("\nYour Current Balance %d\n\n". 85. if ((x =='y')||(x=='Y')) 100. printf("\nYour Current Balance %d\n".&deposit). amount = amount . scanf(" %c". printf("\n\nAnother Transaction? y or n: "). scanf(" %c". 104.amount). 108.&x). 66. printf("Another Transaction? y or n: "). 89.} 92. getch(). 119.} 114. exit(). else if ((x =='n')||(x=='N')) 106. printf("Your Balance %d\n\n". 88. } 105. 64.amount). else 68. if((x =='y')||(x=='Y')) 78. 96. 115. { 103. { 109. 72.amount). break.} 62. goto Loop. 107. exit().withdraw. 79. 118. } 113.transfer. { 81. 69. 74. 110. amount= amount + deposit. {printf("You have an Isuficient Fund\nPress Enter"). break. scanf(" %c". 117. { 87.&x). 86. 65. 116. 71. 102. case 4:{printf("Your Balance %d\n". 98.

default: 154. getch(). 133. if ((x =='y')||(x=='Y')) 122. 126. exit(). printf("\n\nThank You & Come Again"). 145. 151. 160.h></stdio. scanf(" %c". 124. 140. } 127.h> . exit(). 138. 132. 130. else if ((x =='n')||(x=='N')) 128. 165. } 146. } 152. else if ((x =='n')||(x=='N')) 147. printf("Thank You for Banking"). 159.&x). exit(). 148. 123. 149.121. break.} 153. goto Loop. while(repeat). getch(). 162. { 125. case 5:{printf("You Want to Exit? y or n: "). { 150. } 161. getch(). 137. { 131. } 156. 134. 144. 141. goto Loop. 163. if ((x=='y')||(x=='Y')) 139. 166. 143. 164. 129. </conio.} 136. 158. 155. } 157. } 135. break. { 142.