#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int wit(int,int);
int main()
{
int option,r,c;
int pin;
printf("The Bank ATM\n");
printf("Please enter your Personal Identification Number");
scanf("%d",&pin);
if (pin==11)
{
printf("ACCESS GRANTED!");
}
else
{ return 0;
system ("pause");
}
Loop:
{clrscr();
printf("enter an option from the menu below\n\n");
printf("\t\t 1. Withdrawal \n");
printf("\t\t 2. Deposit\n");
printf("\t\t 3. Inquiry\n");
printf("\t\t 4. Pay Bills/Credit Card\n");
printf("Please enter your choice\n");
scanf("%d", & option);
switch (option)
{
case 1:
printf("%d",wit(r,c));
break;
default
rintf("please enter option\n");
}
return 0;
} }
int wit(int c, int r)
{
int newbal=0,current=100,request;
char x;
printf("Enter amount to withdraw: $\n");
scanf("%d",&request);
newbal=current-request;
if(current>=request)
{printf("Your balance after withdrawal is: $%d\n",newbal);
system ("pause");
printf("Another transaction? y or n?: ");
scanf("%c",& x);
if((x == 'y')||(x== 'Y'))
{
goto Loop;
}
else if((x =='n')||(x== 'N'))
{
printf("\nThank You for Banking with us");
//getch();
return 0;
}
}
else
{
printf("Sorry, You do not have sufficient funds \n\n");
system ("pause");
//getch();
}
return 0;
}