#include<stdio.h>
int main()
{
struct transac{
int acc;
char name[10];
char type;
float amount;
};
struct transac custom[5];
int i;
char maxdepcus[10];
char minwithcus[10];
float depo=0,with=0,maxdep=0,minwith=100000000000;
for(i=0;i<5;i++)
{
printf("Enter the details of customer %dnn",i
+1);
printf("Enter the account number: ");
scanf("%d",&custom[i].acc);
printf("Enter the name of the customer: ");
scanf("%s",custom[i].name);
printf("Enter the transaction type(w/d): ");
scanf(" %c",&custom[i].type);
scanf("%f",&custom[i].amount);
}
for(i=0;i<5;i++)
{
if(custom[i].type=='w' || custom[i].type=='W')
{
with=with+custom[i].amount;
if(custom[i].amount>maxdep)
{
maxdep=custom[i].amount;
maxdepcus[10]=custom[i].name;
}
}
else if(custom[i].type=='d' || custom[i].type=='D')
{
depo=depo+custom[i].amount;
if(custom[i].amount<minwith)
{
minwith=custom[i].amount;
minwithcus[10]=custom[i].name;
}
}
}
printf("nTotal deposit amount: %.2fn",depo
);
printf("nTotal withdrawal amount: %.2fn",with
);
printf("nmax dep amount is: %.2fn",maxdep
);
printf("nmin with amount is: %.2fn",minwith
);
printf("nName of the customer who has deposited the maximum amount: %s n",maxdepcus
[10]);
printf("nName of the customer who has withdrawn the minimum amount: %s n",minwithcus
[10]);
return 0;
}