Ask coding questions

← Back to all posts
Why won't this compile??
MarkBrathwaite

#include <stdio.h>
#include <math.h>

int main(void);
{
unsigned int passes = 0;
unsigned int failures = 0;
unsigned int student = 1;
int result;

while (student <= 10) {
printf("%s", "Enter result (1 = pass, 2=fail): ");
scanf("%d", &result);

if ( result == 1 ) {
passes = passes + 1;
}
else {
failures = failures + 1
}
printf("Passed %u\n", passes);
printf("Failed %u\n", failures);

if (passes > 8) {
puts ("bonus to instructor!");
}
}
}

Any help appreciated, error is being created immediately after void declaration.

Voters
MarkBrathwaite
Comments
hotnewtop
EpicGamer007

remove the ; after int main() on line 86

MarkBrathwaite

@EpicGamer007 Thank you!!!