#include<stdio.h>
#include<conio.h>
long amount=1000,deposit,withdrw;
int choise,pin,k;
char transation='y';
void main()
{
clrscr();
while(pin!=1111)
{
printf("enter pin number");
scanf("%d",&pin);
if(pin!=1111)
printf("enter the validet pasoward");
}
do
{
printf(" welcom to atm service ");
printf("1.check balance\n");
printf("2.withdra cash\n");
printf("3.deposit cash\n");
printf("4.exit\n");
printf(" \n\n");
printf("enter your choise");
scanf("%d",&choise);
switch(choise)
{
case 1:
printf("\nyour balance in Rs:%ld",amount);
break;
case 2:
printf("\nenter amount the withdra");
scanf("%ld",&withdrw);
if(withdrw % 100!=0)
{
printf("\nplease enter the amount in multiples of 100");
}
else if (withdrw>(amount-500));
{
printf("\ninsufficent balance");
}
else
{
amount=amount-withdraw;
printf("\n\nplease collect cash");
printf("\nyour current balance is %ld",amount);
}
break;
case 3:
printf("\n enter the amount to deposeit");
scanf("%ld",&deposit);
amount=amount+deposit;
printf("your blance is:%ld",amount);
break;
case 4:
printf("\nthanku using ATM);
break;
}
default;
{
printf("\ninvalid choice");
{
printf("\n\n do you wish to have another transtion ?(y/n:\n");
fflush(stdin);
scanf("%c",&transaction);
if(transaction==n ||transaction==n)
k=1;
}
while(!k)
{
printf("\n\nthanks for using out ATM service");
}
}
}
getch();
}
#include<conio.h>
long amount=1000,deposit,withdrw;
int choise,pin,k;
char transation='y';
void main()
{
clrscr();
while(pin!=1111)
{
printf("enter pin number");
scanf("%d",&pin);
if(pin!=1111)
printf("enter the validet pasoward");
}
do
{
printf(" welcom to atm service ");
printf("1.check balance\n");
printf("2.withdra cash\n");
printf("3.deposit cash\n");
printf("4.exit\n");
printf(" \n\n");
printf("enter your choise");
scanf("%d",&choise);
switch(choise)
{
case 1:
printf("\nyour balance in Rs:%ld",amount);
break;
case 2:
printf("\nenter amount the withdra");
scanf("%ld",&withdrw);
if(withdrw % 100!=0)
{
printf("\nplease enter the amount in multiples of 100");
}
else if (withdrw>(amount-500));
{
printf("\ninsufficent balance");
}
else
{
amount=amount-withdraw;
printf("\n\nplease collect cash");
printf("\nyour current balance is %ld",amount);
}
break;
case 3:
printf("\n enter the amount to deposeit");
scanf("%ld",&deposit);
amount=amount+deposit;
printf("your blance is:%ld",amount);
break;
case 4:
printf("\nthanku using ATM);
break;
}
default;
{
printf("\ninvalid choice");
{
printf("\n\n do you wish to have another transtion ?(y/n:\n");
fflush(stdin);
scanf("%c",&transaction);
if(transaction==n ||transaction==n)
k=1;
}
while(!k)
{
printf("\n\nthanks for using out ATM service");
}
}
}
getch();
}
0 Comments