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
write a program fibonacci series and palindrome program in c
What is an auto variable in c?
Is c programming hard?
When should volatile modifier be used?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
What is keyword in c?
What are pointers? Why are they used?
Explain how can a program be made to print the name of a source file where an error occurs?
How to create struct variables?
Define macros.
What are global variables and explain how do you declare them?
write a program to create a sparse matrix using dynamic memory allocation.
what is different between auto and local static? why should we use local static?
When would you use a pointer to a function?
Write a program to print fibonacci series without using recursion?