# C - Calculate Employee and Employer Provident Fund using C program

In this C program, we will learn how to calculate employee and employer contribution in provident fund (pf) based on basic pay using c program?

In this program, we define two macros for employee and employee fund contribution percentage and taking basic pay as input, based on this percentage, program is calculating provident fund (pf) which is deducting from your salary and employer is contributing.

## Calculate Employee and Employee Provident Fund Contribution using C Program

/*C - Calculate Employee and Employer
Provident Fund using C Program.*/

#include <stdio.h>

#define EMPLOYEE_PERCENTAGE 12.5f
#define EMPLOYER_PERCENTAGE 12.0f

int main(){
float basicPay;
float employeeFund,employerFund;

printf("Enter basic pay: ");
scanf("%f",&basicPay);

employeeFund=(basicPay/100)*EMPLOYEE_PERCENTAGE;
employerFund=(basicPay/100)*EMPLOYER_PERCENTAGE;

printf("Basic Pay: %f\n",basicPay);
printf("Employee contribution: %f\n",employeeFund);
printf("Employer Contribution: %f\n",employerFund);

return 0;
}

Output

Enter basic pay: 35000
Basic Pay: 35000.000000
Employee contribution: 4375.000000
Employer Contribution: 4200.000000

What's New

Top Interview Coding Problems/Challenges!

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates