Hello Members,
I got an error with a recent tax coding project I've been doing. I've run this code before and it ran perfectly but I'm not sure if I misedited a variable or something when I try it I get three errors.
G:\payroll.c In function `main':
On line 21 this is the error -G:\payroll.c syntax error before "else"
This is the code on line 27- else{
On line 48 this is the error -G:\payroll.c syntax error at end of input
This is the code on line 48- return;
This is entire coding from my work
//************************************************** ***************************************
//
//
//************************************************** ******************
#include <stdio.h>
#include <stdlib.h>
#define pause system("pause");
main() {
//
float hourlyRate, hoursWorked, grossPay;
float regPay, otPay;
if(hoursWorked> 40){
regPay=hourlyRate * 40;
otPay= (hoursWorked - 40) * 1.5* hourlyRate ;
//End if
else{
regPay=hourlyrate* hoursWorked;
otPay= 0;
printf("Please enter Your Hourly Rate: ");
scanf("%f", &hourlyRate) ;
printf("Please enter number of hours worked: ");
scanf("%f", &hoursWorked);
grossPay= regPay+otPay ;
printf("====================\n");
printf("Hourly Rate: $%.2f \n",hourlyRate);
printf("Hourly Work: %.1f\n",hoursWorked);
printf("Gross Pay: $%.2f \n");
printf("====================\n");
printf("Gross Pay: $%.2f \n",grossPay);
printf("Gross Pay: $%.2f \n",otPay);
printf("Gross Pay: $%.2f \n",regPay);
pause;
return;
// End of Main
Can anyone help me?