[Solved] [Error]:expected ‘(‘ before ‘hours’


I didn’t read your problem definition but your code sould be at least like this to be correct as syntax and logic:

#include<stdio.h>

float totalFee = 0;
int hours = 0;

int main(void) {

    int i;
    int b;
    printf("Please Enter Number of Cars ");
    scanf("%d", &i);

    for (b = 0; b < i; b++) {
        scanf("%d", &hours);
        if (hours < 8) {
            totalFee += hours * 0.5;
        } else if (hours < 24) {
            float additionalHours = hours - 7;
            totalFee += additionalHours * 5;
            totalFee += hours * 0.5;
        } else {
            float days = hours / 24;
            float extraHours = hours % 24;
            totalFee += days * 50;
            totalFee += days * 24 * 0.5;
            totalFee += extraHours * 5;
            totalFee += extraHours * 0.5;
        }
    }
}

solved [Error]:expected ‘(‘ before ‘hours’