Beruflich Dokumente
Kultur Dokumente
(no subject)
Ishita Saxena <ishita8334@gmail.com> Sun, Jun 16, 2019 at 12:50 AM
To: ishitadeepak8334@gmail.com
Problem Solution
1. Firstly initialize the ATM pin and amount with some random number.
2. Take the ATM pin as input.
3. If the input pin is equal to the initialized pin, then do the further operations.
4. Use switch statement to do the operations like Balance checking, Cash withdrawal, Cash deposition etc.
5. Use while loop to terminate or restart the process.
Program/Source Code
Here is source code of the C Program to display the ATM transaction. The C program is successfully
compiled and run on a Linux system. The program output is also shown below.
1. /*
2. * C Program to Display the ATM Transaction
3. */
4. #include <stdio.h>
5.
6. unsigned long amount=1000, deposit, withdraw;
7. int choice, pin, k;
8. char transaction ='y';
9.
10. void main()
11. {
12. while (pin != 1520)
13. {
14. printf("ENTER YOUR SECRET PIN NUMBER:");
15. scanf("%d", &pin);
16. if (pin != 1520)
17. printf("PLEASE ENTER VALID PASSWORD\n");
18. }
19. do
20. {
21. printf("********Welcome to ATM Service**************\n");
22. printf("1. Check Balance\n");
23. printf("2. Withdraw Cash\n");
24. printf("3. Deposit Cash\n");
25. printf("4. Quit\n");
26. printf("******************?**************************?*\n\n");
27. printf("Enter your choice: ");
https://mail.google.com/mail/u/0?ui=2&ik=e5e9c361bd&view=lg&permmsgid=msg-a%3Ar5973333751666103188&ser=1 1/2
6/27/2019 Gmail - (no subject)
https://mail.google.com/mail/u/0?ui=2&ik=e5e9c361bd&view=lg&permmsgid=msg-a%3Ar5973333751666103188&ser=1 2/2