0
I have a problem here I’m trying to average my vector class_points
, but it gives me a mistake and I do not know how to solve. Someone could enlighten me a little?
int better_than_average(int class_points[], int class_size, int your_points) {
// Your code here :)
// Note: class_size is the length of class_points.
your_points = 80;
class_points[class_size++] = your_points;
int class_average = class_points div class_size;
for (int i; i < class_size; i++)
{
if (your_points > class_average)
{
printf("True");
} else {
printf("False");
}
}
}
Clang output 3.6 / C11
solution.c:9:35: error: expected ';' at end of declaration
int class_average = class_points div class_size;
^
;
1 error generated.
Where did you get this
div
? I think what you wanted was to use/
in his stead. In C, the division of integers is an entire division.– Victor Stafusa