#include <stdio.h>
int main() {
int quantity;
float rate;
float total;
// Output/Input
printf("Quantity: ");
scanf("%d", &quantity);
printf("Rate: ");
scanf("%f", &rate);
total = quantity * rate;
// The discount
if (total > 1000) {
total *= 0.9;
}
printf("The total amount to pay %0.2f", total);
return 0;
}Result
quantity: 20
rate: 100
The total amount to pay 1800.00
Process returned 0 < 0x0> execution time : 4.820 s
Press any key to continue.http://www.AssignmentExpert.com/</stdio.h>
Comments