- #include<stdio.h>
- #include<stdlib.h>
- int list();
- void diposite();
- void last();
- void transfer();
- void withdraw();
- void checkDetail();
- int TotalAmount=1000,Amount,Amo,Tr,TotalDiposite=0,TotalWith=0;
- int TotalTr=0;
- int Acc;
- char a[50];
- void main()
- {
- printf("\nEnter your name: ");
- gets(a);
- printf("\nEnter your Acc number: ");
- scanf("%d",&Acc);
- while(1)
- {
- switch(list())
- {
- case 1:
- diposite();
- TotalDiposite+=Amount;
- break;
- case 2:
- withdraw();
- if(Amo<=TotalAmount)
- TotalWith+=Amo;
- break;
- case 3:
- transfer();
- if(Tr<=TotalAmount)
- TotalTr+=Tr;
- break;
- case 4:
- checkDetail();
- break;
- case 5:
- last();
- exit(0);
- default:
- printf("\nIvalid choice: ");
- } //end of switch
- }//end of while
- }
- int list()
- {
- int ch;
- printf("\n1. Diposite Amount: ");
- printf("\n2. Withdraw Amount: ");
- printf("\n3. Transfer Amount: ");
- printf("\n4. check Details: ");
- printf("\n5. Exit: ");
- printf("\n Enter your choice : ");
- scanf("%d",&ch);
- return(ch);
- }
- void diposite()
- {
- printf("\nEnter the Amount you want to diposite: ");
- scanf("%d",&Amount);
- TotalAmount+=Amount;
- }
- void withdraw()
- {
- printf("\nEnter the Amount you wish to withdraw: ");
- scanf("%d",&Amo);
- if(Amo<=TotalAmount)
- TotalAmount-=Amo;
- else
- printf("\n Less Amount Withdraw is not possible: ");
- }
- void transfer()
- {
- printf("\n Enter the amount u want to transfer: ");
- scanf("%d",&Tr);
- if(Tr<=TotalAmount)
- TotalAmount-=Tr;
- else
- printf("\nLess Amount Transfer is not possible: ");
- }
- void checkDetail()
- {
- printf("\nTotal Amount=%d",TotalAmount);
- printf("\nTotal Diposited Amount=%d",TotalDiposite);
- printf("\nTotal Withdraw Amount=%d ",TotalWith);
- printf("\nTotal Transfered Amount=%d",TotalTr);
- }
- void last()
- {
- printf("\n****************\n");
- printf("\nYour Name=%s",a);
- printf("\nAccount Number=%d",Acc);
- printf("\n Total Amount=%d",TotalAmount);
- printf("\n Total Diposited Amount=%d",TotalDiposite);
- printf("\n Total withdraw Amount=%d ,TotalWith");
- printf("\nTotal Transfered Amount=%d",TotalTr);
- printf("\n \n*******THANKS**");
- }
Bnaking Managements projects using C language
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated