float sum, comm;
printf("Enter value of trade: ");
scanf("%f", &sum);
while(sum != 0){
if (sum < 2500)
comm = 30 + sum * 0.017;
else if(sum < 6250)
comm = 56 + sum * 0.0066;
else if(sum < 20000)
comm = 76 + sum * 0.0034;
else if(sum < 50000)
comm = 100 + sum * 0.0022;
else if(sum < 500000)
comm = 155 + sum * 0.0011;
else
comm = 255 + sum * 0.0009;
if(comm < 39)
comm = 39;
printf("Commission: $%.2f\n", comm);
scanf("%f", &sum);
}
printf("Enter value of trade: 0");