fork download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4. //Variables
  5. char employeeName[] = "Nathan Gavriel Garcia";
  6. int hoursWorked = 80;
  7. float hourlyRate = 900;
  8. //Computation
  9. float grossPay = hoursWorked*hourlyRate;
  10. float tax = 0.10 * grossPay;
  11. float netPay = grossPay-tax;
  12. //Display
  13. puts("====================================");
  14. printf(" EMOPLOYEE PAYROLL\n");
  15. puts("====================================");
  16. printf("Employee Name: %s\n", employeeName);
  17. printf("Hours Worked : %d\n", hoursWorked);
  18. printf("Hourly Rate : Php %.2f\n", hourlyRate);
  19. printf("Gross Pay : Php %.2f\n", grossPay);
  20. printf("Tax (10%%) : Php %.2f\n", tax);
  21. printf("Net Pay : Php %.2f\n", netPay);
  22. puts("====================================");
  23. return 0;
  24.  
  25. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
====================================
 EMOPLOYEE PAYROLL
====================================
Employee Name: Nathan Gavriel Garcia
Hours Worked : 80
Hourly Rate : Php 900.00
Gross Pay : Php 72000.00
Tax (10%) : Php 7200.00
Net Pay : Php 64800.00
====================================