Write a C program to compute the monthly pay of 100 employees using each employee’s name, basic pay. The DA is computed as 52% of the basic pay. Gross-salary (basic pay + DA). Print the employees name and gross salary.

Program Code:
#include<stdio.h>
struct employee
{
char name[20];
float basic;
float da;
float gross;
}e[5];
void main()
{
inti;
for(i=0;i<5;i++)
scanf("%s%f",e[i].name,&e[i].basic);
for(i=0;i<5;i++)
{
e[i].da=52.0/100*e[i].basic;
e[i].gross=e[i].da+e[i].basic;
printf("\n name=%s gross=%f",e[i].name,e[i].gross);
}
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: