Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main() {
- float salesAmount = 0;
- int numberOfSalesman = 0;
- int twentyPercent=0, fifteenPercent=0, thirteen=0, zero=0;
- printf("Salesmans's Sales Generator\n");
- printf("Enter how many salesman (Maximum of 50): ");
- scanf("%d", &numberOfSalesman);
- printf("\n");
- int i = 1;
- while (i <= numberOfSalesman) {
- printf("Enter salesman %d sales: ", i);
- scanf("%f", & salesAmount);
- if (salesAmount > 20000) {
- twentyPercent++;
- }
- if (salesAmount >= 15000 && salesAmount <= 20000) {
- fifteenPercent++;
- }
- if (salesAmount < 15000) {
- thirteen++;
- }
- if (salesAmount == 0) {
- zero++;
- }
- i++;
- }
- printf("\nTotal Commission 20%%: %d \n", twentyPercent);
- printf("Total commission 15%%: %d \n", fifteenPercent);
- printf("Total commission 13%%: %d \n", thirteen);
- printf("Zero Commission: %d", zero);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement