In a company an employee is paid as under : If his basic salary is less than Rs. 1500, then HRA=10% of basic salary and DA=90% of basic salary. If his salary is either equal to or above Rs.1500, then HRA=Rs. 500 and DA=98% of basic salary. If the employee’s salary isentered through the keyboard WAP to find his gross salary.

 

#include<stdio.h>
#include<conio.h>
int main()
{
    int bs,ts,hra,da,a,b,salary;
    printf("enter the basic salary : ");
    scanf("%d",&bs);
    if (bs<1500)
    {
      hra=bs*0.10;
      da=bs*0.90;
    }
    
    else if (bs>=1500)
    {
      hra=500;
      da=bs*0.98;
    }
    
   ts=bs+hra+da;
   printf("gross salary of employee is :%d",ts);


    return 0;
}


output 1:
enter the basic salary : 1400 gross salary of employee is :2800

output 2 :
enter the basic salary : 1500
gross salary of employee is :3469

output 3 :
enter the basic salary : 1600 gross salary of employee is :3667


Comments

Popular Post

Define a class to represent a Bank Account. Include the following members: Data Members: i. Name of the depositor ii. Account number iii. Type of account iv. Balance amount in the account Member Functions: 1. To Input initial values 2. To deposit an amount 3. To withdraw an amount after checking the balance 4. To display name and balance Also write constructor for this class that takes four arguments. It should also handle type of account as savings by default