Home / Programs / Program to find gross salary
Programming Example

Program to find gross salary

👁 1,293 Views
💻 Practical Program
📘 Step by Step Learning
In this program we will show how to calculate gross salary.

Program Code

/* Program to find gross salary
  Author: Atnyla Developer */

#include"stdio.h"
#include"conio.h"
void main()
{
int gs,bs,da,ta;
 
 printf("enter basic salary: ");
 scanf("%d",&bs);
 
 da=(10*bs)/100;
 ta=(12*bs)/100;
 
 gs=bs+da+ta;
 
 printf("gross salary=%d \n",gs);
 getch();
}

Output

enter basic salary: 12000
gross salary=14640
Press any key to continue . . .

Explanation

Formula
 da=(10*bs)/100;
 ta=(12*bs)/100;
 
 gs=bs+da+ta;

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.