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
Is main is a keyword in c?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What does typeof return in c?
What is const volatile variable in c?
Explain void pointer?
Explain how can I make sure that my program is the only one accessing a file?
What does printf does?
how to make a scientific calculater ?
Explain the difference between null pointer and void pointer.
Why do we use main function?
what value is returned to operating system after program execution?
Explain how can I pad a string to a known length?
What is the use of f in c?
Explain what will the preprocessor do for a program?
What is the sizeof () operator?