0

Pls somebody should help with the code that will compute ATM system in C language

Using switch

3rd May 2019, 11:42 AM
Ibrahim Abdulrashid
Ibrahim Abdulrashid - avatar
4 Antworten
+ 3
Please post what have you already done. Nobody here will do whole work for you, if you have specific problem ask just for it.
3rd May 2019, 11:49 AM
Maneren
Maneren - avatar
+ 1
Upload your trial and I or someone else will help go through it with you. It isn't that hard so give it a try first.
3rd May 2019, 11:48 AM
Mensch
Mensch - avatar
0
#include<stdio.h> int main() { float amt,creditamt,debitamt; char ch; printf("Enter initial amount\n"); scanf("%f",&amt); printf("Enter\nc for credit\nd for debit\nb for balance\n"); scanf("\n%c",&ch); switch(ch) { case 'c': printf("Enter credit amount\n"); scanf("%f",&creditamt); amt=amt+creditamt; printf("New Amount=%f",amt); break; case 'd': printf("Enter debit amount\n"); scanf("%f",&debitamt); if(amt>=debitamt) { amt=amt-debitamt; printf("New Amount=%f",amt); } else { printf("Insufficient amount"); } break; case 'b': printf("Amount in your account=%f",amt); break; default: printf("Invalid input!!"); } }
3rd May 2019, 3:40 PM
Ibrahim Abdulrashid
Ibrahim Abdulrashid - avatar
0
I want it to be more interactive
3rd May 2019, 3:41 PM
Ibrahim Abdulrashid
Ibrahim Abdulrashid - avatar