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
List out few of the applications that make use of Multilinked Structures?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
How important is structure in life?
What are variables c?
If fflush wont work, what can I use to flush input?
What is the use of define in c?
How can I avoid the abort, retry, fail messages?
What is sizeof c?
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
Who invented b language?
What is the difference between new and malloc functions?
What is the difference between abs() and fabs() functions?
Explain the properties of union. What is the size of a union variable
What is the difference between formatted&unformatted i/o functions?
What are external variables in c?