fork download
  1. #include <stdio.h>
  2. int main() {
  3. int ctr, salary, EMP_80= 0;
  4. int total_payroll = 0;
  5. printf("Enter the monthly salary for each of the 10 employees:\n");
  6. for (ctr = 1; ctr <= 10; ctr++) {
  7. printf("Enter salary for employee #%d: ", ctr);
  8. scanf("%d", &salary);
  9. if (salary >= 80) {
  10. EMP_80++;
  11. }
  12. total_payroll += salary;
  13. }
  14. printf("\nNumber of employees receiving a monthly salary of 80 and above = %d\n", EMP_80);
  15. printf("Total monthly salary or payroll paid out by the company = %d\n", total_payroll);
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout 0.01s 5288KB
stdin
45
stdout
Enter the monthly salary for each of the 10 employees:
Enter salary for employee #1: Enter salary for employee #2: Enter salary for employee #3: Enter salary for employee #4: Enter salary for employee #5: Enter salary for employee #6: Enter salary for employee #7: Enter salary for employee #8: Enter salary for employee #9: Enter salary for employee #10: 
Number of employees receiving a monthly salary of 80 and above = 0
Total monthly salary or payroll paid out by the company = 450