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.
1
Expert's answer
2016-03-09T08:36:42-0500
#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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS