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 header file is in C language ?

44 Answers   College School Exams Tests, CTS, IBM, IMS, Infosys, ME, Sign Solutions, Wipro, XVT,


what is difference between ANSI structure and C99 Structure?

1 Answers   Wipro,


how to return 1000 variables from functio9n in c?plz give me code also

6 Answers  


What is the purpose of 'register' keyword in c language?

0 Answers  


what is the difference between #include<stdio.h> and #include"stdio.h" ?

6 Answers   TCS,






How do we declare variables in c?

0 Answers  


the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters

2 Answers  


is it possible to change the default calling convention in c ?

1 Answers   Aptech,


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

0 Answers  


What is wrong with this program statement? void = 10;

0 Answers  


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.

1 Answers  


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

17 Answers   ME,


Categories