Answer:
#include <stdio.h>
int main()
{
int customers, count = 0;
float checking, savings, totalCheching = 0, totalSavings = 0;
printf("How many customers?");
scanf("%d", &customers);
for(int i=0;i<customers;i++){
printf("Enter checking account balance: ");
scanf("%f", &checking);
totalCheching += checking;
printf("Enter savings account balance: ");
scanf("%f", &savings);
totalSavings += savings;
if(checking > savings){
count++;
}
}
printf("Total in checkings: %f \\", totalCheching);
printf("Total in savings: %f \\", totalSavings);
printf("There are %d customers have MORE money in their checking account than in their savings account", count);
return 0;
}
Step-by-step explanation:
Initialize the variables
Get the number of customers from the user
Create a for loop iterates "number of customer" times. Inside the loop, get the checking and saving balance, and calculate their total. If checking is greater than saving, increment count by 1.
When the loop is done, print the totals and count