Monday, 21 June 2021

Atm machine system mini project in c language

 Atm machine system mini project in c language



#include <stdio.h>

int main()
{
    float xy;
    char ch;
    printf("Please enter your amount\n");
    scanf("%f", &x);
    printf("\nplease choose \n c for creadit , d for debit and b for balance checking\n");
    scanf("\n%c", &ch);
    switch (ch)
    {
    case 'c':
        printf("Please enter your amount\n");
        scanf("%f", &y);
        x = x + y;
        printf("your total balace is = %f "x);

        break;
    case 'd':
        printf("Please enter your amount for debit\n");
        scanf("%f", &y);
        if (x >= y)
        {
            x = x - y;
            printf("your total balance is = %f"x);
        }
        else
        {
            printf("Please enter amount under your account balance");
        }
        break;
    case 'b':
        printf("your total balance is = %f"x);
        break;
    default:
        printf("Please choose only c for creadit , d for debit and b for balance checking");
        break;
    }
    return 0;
}
// source code in the description
// run code

No comments:

By laptop