Pele needs a program to calculate his bank balance at the end of the month. Get his balance at the beginning of the month and his deposit and withdrawal amounts during the month. Bank costs are fixed at R55.66 per month. Calculate and display his balance at the end of the month.
Select the best variable name for the balance at the beginning of the month.
#include <stdio.h>
int main()
{
float intial_balance; //variable to take begining money from the user
float deposit;
float withdraw;
float bankcost=55.66;
scanf("%f",&intial_balance);
scanf("%f",&deposit);
scanf("%f",&withdraw);
float final_balance=intital_balance+deposit-withdraw-bankcost;
printf("%0.2f",final_balance); // display final balance
return 0;
}
Comments
Leave a comment