Tuesday, January 8, 2013

Create Structure for take input all Bank Information. (Bank App)


#include<stdio.h>
#include<conio.h>
struct bank
{
char bname[20],name[20];
long int acn,bl,wid,dep;
}v;

void main()
{
int x;
clrscr();

printf("\n\n\tEnter Bank Name : ");
gets(v.bname);
printf("\tEnter Your Name : ");
gets(v.name);
fflush(stdin);
printf("\tEnter Bank Account Number : ");
scanf("%ld",&v.acn);
printf("\tEnter Bank Account Balance : ");
scanf("%ld",&v.bl);

printf("\n\tYou want to Depose & widhdrow?\n");
printf("\n\tPress 1 for withdrow\n\tPress 2 for Deposite");
printf("\n\n\tEnter Choice : ");
scanf("%d",&x);

if(x==1)
{
printf("\n\tEnter your Widhdrow Amount");
scanf("%ld",&v.wid);
v.bl=v.bl-v.wid;
printf("\tAmount successful widhdrow ! ");
}
else if (x==2)
{
printf("\n\tEnter your Deposite Amount");
scanf("%ld",&v.dep);
v.bl=v.bl+v.dep;
printf("\tAmount successful widhdrow !" );
}

clrscr();
printf("\n\tYour Final account status \n");
printf("\n\tBank Name : %s\n\tName : %s\n\tAccount Number :%ld\n\tMain Balance : %ld",v.bname,v.name,v.acn,v.bl);
getch();
}

No comments:

Post a Comment