## Emploee Salary Calculation using Structures

### Description

`Get wages of n employees and calculate the basic pay, HRA and Net pay of each employee.`

### Solution

```#include<stdio.h>
struct employee
{
char name[50];
int wages;
float days,basic_pay,hra,net_pay;
};
int main()
{
int n,i;
scanf("%d",&n);
struct employee e[n];
for(i=0;i<n;i++)
{
scanf("%s",e[i].name);
scanf("%d %f",&e[i].wages,&e[i].days);
e[i].basic_pay=e[i].wages*e[i].days;
e[i].hra=e[i].basic_pay * 0.12;
e[i].net_pay=e[i].hra+e[i].basic_pay;

}
for(i=0;i<n;i++)
{
printf("Name: %s\nBasicPay: %f\nHRA:%f\nNetPay:%f\n",e[i].name,e[i].basic_pay,e[i].hra,e[i].net_pay);
}

}
```

### Explanation

`create a structure variable as array and store the employee details.`

#### Author - Ramesh P Natarajan

Learner, Professor, Technology Trainer, Software Developer and Content Marketer, very much passionate in the field of Software Application Development, Machine Learning and Search Engine Optimization.

Write to: [email protected]

### Interesting Pattern Programs: for more Patterns

```Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution```
```Input:
5
Output:
*
***
*****
*******
*********
*******
*****
***
*Solution```
```Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution```
```Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution```
```Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution```
```Input:
5
Output:
*********
*******
*****
***
*
***
*****
*******
*********Solution```