0% found this document useful (0 votes)
1K views3 pages

Atm C Language Program Code

This document contains code for an ATM program with the following functionality: 1) It prompts the user to enter a pin code and only continues if the correct pin of 1234 is entered. 2) It displays a menu with options to check balance, withdraw cash, deposit cash, and quit. 3) For each selected option it performs the corresponding action, such as withdrawing cash if balance is sufficient and in multiples of 100, displaying current balance, and updating the running balance total.

Uploaded by

9y9a
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
1K views3 pages

Atm C Language Program Code

This document contains code for an ATM program with the following functionality: 1) It prompts the user to enter a pin code and only continues if the correct pin of 1234 is entered. 2) It displays a menu with options to check balance, withdraw cash, deposit cash, and quit. 3) For each selected option it performs the corresponding action, such as withdrawing cash if balance is sufficient and in multiples of 100, displaying current balance, and updating the running balance total.

Uploaded by

9y9a
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 3

/*Note Pin code is 1234*/ #include<stdio.h> #include<conio.

h> void main(void) { unsigned long amount=1000,deposit,withdraw; int choice,pin=0,k=0; char another='y'; while(pin!=1234) { clrscr(); gotoxy(30,25); printf("Enter pin:"); scanf("%d",&pin); } clrscr(); do { printf("********Welcome to ATM Service**************\n"); printf("1. Check Balance\n"); printf("2. Withdraw Cash\n"); printf("3. Deposit Cash\n"); printf("4. Quit\n"); printf("******************?**************************?*\n\n"); printf("Enter your choice: "); scanf("%d",&choice);

switch(choice) { case 1: printf("\nYour Balance is Rs : %lu ",amount); break; case 2: printf("\nEnter the amount to withdraw: "); scanf("%lu",&withdraw); if(withdraw%100!=0) { printf("\nPlease enter amount in multiples of 100"); } else if(withdraw>(amount-500)) { printf("\nInsufficient Funds"); }else { amount=amount-withdraw; printf("\n\nPlease collect cash"); printf("\nYour balance is %lu",amount); } break; case 3: printf("\nEnter amount to deposit"); scanf("%lu",&deposit); amount=amount+deposit; printf("Your balance is %lu",amount); break; case 4: printf("\nThank you for using ATM"); break; default: printf("\nInvalid Choice");

} printf("\n\n\nDo you want another transaction?(y/n): "); fflush(stdin); scanf("%c",&another); if(another=='n'||another=='N') k=1; }while(!k); printf("\n\nHave a nice day"); getch(); }

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy