Advertisement
valve2

simple prog that calc's commission using a for loop

Jan 23rd, 2023 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. //s1mple prog that calc's commission
  2. int employee, employees;
  3. float sales, com, comrate = 0.10, inrc;
  4. #include <stdio.h>
  5. int main() {
  6.     printf("Enter the number of employees\n");
  7.     scanf_s("%d", &employees);
  8.     for (employee = 1; employee <= employees; employee++) {
  9.         printf("Enter your sales\n");
  10.         scanf_s("%fl", &sales);
  11.         com = comrate * sales;
  12.         printf("the com of employee %d is %fl\n",employee, com);
  13.         printf("-----------------------------\n");
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement