Header Ads Widget

Responsive Advertisement

Basic salary of an employee is input through the keyboard. The DA is 25% of the basic salary while the HRA is 15% of the basic salary. Provident Fund is deducted at the rate of 10% of the gross salary (BS+DA+HRA). Program to calculate the Net Salary. Sample test cases

 #include<stdio.h>

int main () 

float net, hra, da, gs, result; 

printf ("Enter Basic Salary:"); 

scanf ("%f", &net); 

da= net * 25/100; hra = net * 15/100; 

gs = net+da+hra; 

result=gs-gs*10/100; 

printf ("Net Salary is: $%0.2f\n", result); 

return 0; 


Post a Comment

0 Comments