C Program for Employee Salary Calculation
#include<stdio.h> #include<conio.h> void main() { char id[5], empname[30]; int hour=8, days; double value, salary, hra, da, ma, pf, income_tax, netsalary; clrscr(); printf("Enter the Employee's ID: "); scanf("%s", &id); printf("Enter the Employee's Name: "); scanf(" %[^\n]s", &empname); printf("\nSalary amount/hr: "); scanf("%lf", &value); printf("\nHow many days you have worked/month: "); scanf("%d", &days); salary = (value * hour)*days; hra=salary*0.1; da=salary*0.05; ma=salary*0.05; pf=salary*0.10; income_tax=salary*0.10; netsalary=(salary + hra + da + ma)- income_tax - pf; printf("\nEmployee's ID: %s \nEmployee's Name: %s \nSalary = RS.%.2lf\n", id, empname, netsalary); getch(); }
Output: