An interactive c program to read basic salary of 15
persons. each person gets 25% of basic as HRA, 15%of basic
as conveyance allowances, 10%of basic as entertainment
allowances.The total salary is calculated by adding
basic+HRA+CA+EA.Calculate how many out of 15 get salary
above 10,000.Rs also print the salary of each employee

Answers were Sorted based on User's Feedback



An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA,..

Answer / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int salary[50],n,count=0,result[50];
float HRA,CON,JOLLY,TOT_salary;
clrscr();
printf("enter no. of employees : ");
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
printf("%d) ",i);
scanf("%d",&salary[i-1]);
HRA=0.25*salary;
CON=0.15*salary;
JOLLY=0.10*salary;
TOT_salary=HRA+CON+JOLLY;
printf("\nnet salary for %d) is :%f\n",i,TOT_salary);
if(TOT_salary>10000)
{
count++; // TO COUNT EMPLOYEES GETTING MORE THAN 10,000
result[i-1]=i; //TO SAY WHICH SERIAL NO. GETS ABOVE 10,000
}
}
printf("the total no. of employees crossed rs. 10,000 is :%d & respected numbers as above is :",count);
for(i=0;i<count;i++)
printf("%d)\n ",result[i]);
getch();
}

Is This Answer Correct ?    7 Yes 3 No

An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA,..

Answer / gunda raj

void main()
{
int COUNT=0,BS,HRA,CA,EA,TOTAL[20] ;

FOR(int i=0;i<15;i++)
{
cout<<"enter basic salary";
cin>>BS;
HRA=(BS/100)*25;
CA=(BS/100)*15;

EA=(BS/100)*10;

TOTAL=BS+HRA+CA+EA;
cout<<"total salary of"<<i<< "employee is"<<TOTAL[i];
}
FOR(INT I=0;I<=14;I++)
{

if(TOTAL[I]>=10000)
COUNT++
}
COUT<<"THE NUMBER OF EMPLOYEES ABOVE 10000 ARE"<<COUNT;
}

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More C Interview Questions

What are the different pointer models in c?

4 Answers  


What are the different data types in C?

0 Answers  


wht is the difference between KPO and BPO ?

2 Answers   Accenture, BPO, HCK, HCL, Infosys,


What is sizeof c?

0 Answers  


How many bytes are occupied by near, far and huge pointers (dos)?

0 Answers  






Why does notstrcat(string, "!");Work?

0 Answers  


Why static is used in c?

0 Answers  


print a "hello" word without using printf n puts in c language

6 Answers  


What is the difference between malloc() and calloc()?

0 Answers  


Write a c program to enter a string of paragraph and replacing a particular word which is repeated in the paragraph by another word?

2 Answers   ME, Synfusion, Wipro,


What is storage class?

0 Answers  


How is a two dimensional array passed to function when the order of matrix is not known at complie time?

1 Answers   CSC,


Categories