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

Is main is a keyword in c?

602


a value that does not change during program execution a) variabe b) argument c) parameter d) none

690


What does typeof return in c?

635


What is const volatile variable in c?

572


Explain void pointer?

587






Explain how can I make sure that my program is the only one accessing a file?

618


What does printf does?

739


how to make a scientific calculater ?

1561


Explain the difference between null pointer and void pointer.

663


Why do we use main function?

630


what value is returned to operating system after program execution?

1597


Explain how can I pad a string to a known length?

647


What is the use of f in c?

553


Explain what will the preprocessor do for a program?

593


What is the sizeof () operator?

618