-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestion_31.c
37 lines (30 loc) · 993 Bytes
/
Question_31.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdio.h>
int main()
{
float total_amount,withdraw_amount;
char choice;
printf("Enter the total amount in your account :");
scanf("%f",&total_amount);
printf("Enter the amount you want to withdraw from your account :");
scanf("%f",&withdraw_amount);
if (withdraw_amount <= total_amount)
{
printf("Rupees %.2f have been withdrawn\n",withdraw_amount);
printf("Do you want to check the remaining balance?\n");
printf("Please enter 'Y' or 'N'\n");
scanf(" %c",&choice);
if(choice == 'Y' || choice == 'y')
{
printf("%.2f is the remaining balance\n", total_amount - withdraw_amount);
printf("Thank You for using our services");
}
else if (choice == 'N' || choice == 'n')
{
printf("Thank You for using our services");
}
}
else
{
printf("Transaction can't be processed due to insufficicient funds in your account");
}
}