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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain #pragma statements.

604


Is there sort function in c?

578


What is the stack in c?

720


What is file in c preprocessor?

653


What's the best way of making my program efficient?

627






Multiply an Integer Number by 2 Without Using Multiplication Operator

320


What is size of union in c?

578


What tq means in chat?

579


What are high level languages like C and FORTRAN also known as?

686


What are different types of operators?

596


What is pointer to pointer in c?

634


What is a protocol in c?

559


Can you please explain the difference between exit() and _exit() function?

592


Explain how can you avoid including a header more than once?

601


What is #line?

611