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 data types in C?

0 Answers  


WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR LOOPS. A) * B) ***** *** * * ***** * * *****

2 Answers  


What is meant by inheritance?

0 Answers  


What's the total generic pointer type?

0 Answers  


What has to put when we are inserting as assembly language code into the C code? or When we are inserting as assembly language code into the C code we have to insert one thing at the start and of the assembly language. What are they?

2 Answers  






Explain what is the difference between a string and an array?

0 Answers  


Is javascript based on c?

0 Answers  


Why should I prototype a function?

0 Answers  


what is the diff between the printf and sprintf functions?? and what is the syntax for this two functions ??

5 Answers  


What is union in c?

0 Answers  


Explain main function in c?

0 Answers  


1 232 34543 4567654 can anyone tell me how to slove this c question

6 Answers  


Categories