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

Create a base class called shape .Use this class to store two double type values that could be used to compute the area of figures, Derive two specific classes called triangle and rectangle from the base shape .Add to the base class, a member function get_data() to initialise base class data members and another member function display_area() to compute and display the area of figures. Make display_area () as a virtual function and redefine this function in the derived class to suit their requirements. Using these three classes, design a program that will accept dimensions of a triangle or a rectangle interactively and display the area. Area of rectangle = x*y Area of triangle = ½*x*y