Quote:
I tried to run it without the float statement and it worked so the problem is in the float statement I want to know why
Because the float line is not C.
int average = 0 ;
float=0.0;
Because just like for any other variables, when you declare it, it is datatype, then variable name.