scanf("%lu", &deposit); amount = amount + deposit; printf("YOUR BALANCE IS %lu", amount); break; case 4: printf("\n THANK U USING ATM"); default: break; } printf("\n INVALID CHOICE"); printf("\n\n\n DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): \n"); fflush(stdin); scanf("%c", &transaction); k = 1; if (transaction == 'n'|| transaction == 'N') } while (!k); printf("\n\n THANKS FOR OUT ATM SERVICE"); } Output: ENTER YOUR SECRET PIN NUMBER:1520 ********Welcome to ATM Service************** Balance Withdraw Cash Deposit Cash Quit ******************?**************************?* Enter your choice: 1 YOUR BALANCE IN Rs : 1000 DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): ********Welcome to ATM Service************** Balance Withdraw Cash Deposit Cash Quit ******************?**************************?* Enter your choice: 2 ENTER THE AMOUNT TO WITHDRAW: 200 PLEASE COLLECT CASH YOUR CURRENT BALANCE IS800
scanf("%lu", &deposit); amount = amount + deposit; printf("YOUR BALANCE IS %lu", amount); break; case 4: default: } printf("\n THANK U USING ATM"); break; printf("\n INVALID CHOICE"); k = 1; printf("\n\n\n DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): \n"); fflush(stdin); scanf("%c", &transaction); if (transaction == 'n'|| transaction == 'N') } while (!k); printf("\n\n THANKS FOR OUT ATM SERVICE"); } Output: ENTER YOUR SECRET PIN NUMBER:1520 ********Welcome to ATM Service************** Balance Withdraw Cash Deposit Cash Quit ******************?**************************?* Enter your choice: 1 YOUR BALANCE IN Rs : 1000 DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): ********Welcome to ATM Service************** Balance Withdraw Cash Deposit Cash Quit ******************?**************************?* Enter your choice: 2 ENTER THE AMOUNT TO WITHDRAW: 200 PLEASE COLLECT CASH YOUR CURRENT BALANCE IS800