Question No:1
General Forge and Foundry pays its salespeople by commission. If a salesperson sells less than Rs.10,000 in a week the commission is 4% of the sales. Other
commission is 5%. Write a program that will accept the amount of sales in a week
from 'N' salespersons, then outputs the amount of commission earned by ea
Input format
Number of Sales person(N) in first line
N person's sales amount in separate lines
Output format
Each salesperson's commission in a separate line and the total commission
Sample testcases
Input 1
5
10000
1000
5000
4000
150000
Output 1
Person 1 : 500.00
Person 2 : 40.00
Person 3 : 200.00
Person 4 : 160.00
Person 5 : 7500.00
Total Commission : 8400.00
Answers
Answered by
2
Answer:
plz mark me as brainliest.
plz follow me...
thanks...
Attachments:
Answered by
5
Answer:
#include<stdio.h> #include<stdlib.h>
int main()
{
int g;
int no of sp;
float sale;
float totalcomm=0;
scanf("%d", &no_of_sp);
for (g=1;g<=no_of_sp;g++); {
{
scanf("%f",&sale); if(sale<1000)
{
totalcomm =totalcomm sale 0.04; printf("Person %d : %.2f\n",g, sale 0.04);
}
else
{
totalcomm = totalcomm+sale 0.05;
printf("Person %d : %.2f\n",g, sale *0.05);
else
}
}
printf("Total Commission :%.2f", totalcomm);
return 0;
}
Similar questions