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
What is a void pointer? When is a void pointer used?
Explain the difference between getch() and getche() in c?
What is getch() function?
If null and 0 are equivalent as null pointer constants, which should I use?
What is the difference between functions abs() and fabs()?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Does c have function or method?
What is formal argument?
Why does everyone say not to use scanf? What should I use instead?
Can you apply link and association interchangeably?
How do you determine the length of a string value that was stored in a variable?
Where define directive used?
write a c program in such a way that if we enter the today date the output should be next day's date.
Why void is used in c?