Write the program with at least two functions to solve the
following problem. The members of the board of a small
university are considering voting for a pay increase for
their 5 faculty members. They are considering a pay
increase of 8%. Write a program that will prompt for and
accept the current salary for each of the faculty members,
then calculate and display their individual pay increases.

At the end of the program, print the total faculty payroll
before and after the pay increase, and the total pay
increase involved.




Write the program with at least two functions to solve the following problem. The members of the bo..

Answer / sammy

#include <stdio.h>
#include <stdlib.h>
double getIncrease (double curSal);

int main (void)
{
double CurrentSal[3];
double payIncreases[3];

for(int i=0; i<3; i++)
{
printf("Enter the salary for employee %d: $", i+1);
scanf("%d", &CurrentSal);
}

for (int j=0; j<3; j++)
{
payIncreases[j] = getIncrease(CurrentSal[j]);
printf("The pay increase for employee %d is $%d\n",j+1,
payIncreases[j]);
}
system ("pause");
return 0;
}
double getIncrease (double curSal)
{
double PayIncrease;
PayIncrease = curSal*.08;

return PayIncrease;
}

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

How many loops are there in c?

0 Answers  


What is #line?

0 Answers  


What is the use of structure padding in c?

0 Answers  


Define Array of pointers.

0 Answers  


main() { int i=5; printf("%d%d%d%d",i++,i--,i); }

10 Answers  






write a progrmm in c language take user interface generate table using for loop?

0 Answers  


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

0 Answers  


How is = symbol different from == symbol in c programming?

0 Answers  


Code for calculating square root without using library function, of math.h

4 Answers   IBM,


How do you write a program which produces its own source code as its output?

4 Answers  


List some applications of c programming language?

0 Answers  


What is line in c preprocessor?

0 Answers  


Categories