#include <iostream.h>
float salary (int, float);
int main()
{
int n,h,i;
float r,GS;
cout <<"Enter number of employees: ";
cin >> n;
for (i=0;i<n;i++)
{
cout << "\n Hours= \t";
cin >>h;
cout<< "\n Rate= \t";
cin >> r;
GS=salary(h,r);
cout << "\nSalary=\t"<<GS << "\n";
cout << "Rate=\t"<<r<<"\n\n";
}
return 0;
}
float salary(int h, float r)
{
float a;
if (h > 40)
r=r+ 20% ;
a=h*r;
return(a);
}
The calculation is wrong