C program to enter basic salary of an employee and calculate gross salary
Posted by Samath
Last Updated: January 02, 2017

Write a C program to enter basic salary of an employee and calculate gross salary.

To find out gross salary, we are going to take the basic salary of a employee as an input. Find out D.A. and T.A. according to basic salary and then add them all.

Code:

#include<stdio.h>
 
int main() {
   int gross_salary, salary, da, ta;
 
   printf("Enter salary salary : ");
   scanf("%d", &salary);
 
   da = (10 * salary) / 100;
   ta = (12 * salary) / 100;
 
   gross_salary = salary + da + ta;
 
   printf("\nGross salary: %d", gross_salary);
   return (0);
}