fork download
  1. /******************************************************************************
  2.  
  3.   Online C Compiler.
  4.   Code, Compile, Run and Debug C program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <stdio.h>
  10. int main()
  11. {
  12. char name[25];
  13. int id;
  14. float da, basic, hra, pf, it, gross, deduction, netsal;
  15. printf("Enter the employee number, name and basic salary");
  16. scanf("%d%c%f",&id,&name,&basic);
  17. da = .40*basic;
  18. hra = .20*basic;
  19. pf = .12*basic;
  20. it = .04*basic;
  21. gross = basic+ hra + da + pf;
  22. deduction = it;
  23. netsal = gross - deduction;
  24. printf("**************************************");
  25. printf("Employee number is %d\n", id);
  26. printf("employee name = %s\n", name);
  27. printf("basic pay = %f\n", basic);
  28. printf("dearness allowance = %f\n", da);
  29. printf("house rent allowance = %f\n",hra);
  30. printf("provident fund = %f\n",pf);
  31. printf("gross salary = %f\n", gross);
  32. printf(" deduction = %f\n", deduction);
  33. printf("net salary = %f\n",netsal);
  34. printf("**************************************");
  35. }
  36.  
Success #stdin #stdout 0s 4464KB
stdin
Standard input is empty
stdout
Enter the employee number, name and basic salary**************************************Employee number is  -1061039147
employee name =  �U��+
basic pay = 0.000000
dearness allowance = 0.000000
house rent allowance = 0.000000
provident fund = 0.000000
gross salary = 0.000000
 deduction = 0.000000
net salary = 0.000000
**************************************