Because in your conditions, you check if(hoursWorked[i] < 40)
and if(hoursWorked[i] > 40)
, but there is no condition for if(hoursWorked[i] == 40)
. You probably wanted to use -or-equal operator on one of these conditions (>=
or <=
).
solved Array not displaying proper output