67 107
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #58162 in C for lovemore kateya

Question #58162
write a program that calculates and displays the price before commission and after commission of 6%: The program prompt the user to enter
i. Quantity of products purchased
ii. Unit price.
Expert's answer
#include <stdio.h>

int main()
{
int nunberOfProducts;
float price;

printf("Number of units: ");
scanf("%d", &nunberOfProducts);

for(int i=0;i<nunberOfProducts; i++)
{
printf("Before commission: ");
scanf("%f", &price);

double commision = price*6/100;
price-=commision;

printf("After commission: ");
printf("%f \n", price);

}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions