I wrote this code to find out the average of any 3 numbers. Please help me out. I'd like to know where it went wrong. I wrote the same code in a new file and that was executed without any issues.
This is what I keep getting:
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status
#include <stdio.h>
//average of three numbers
int main() {
int n1, n2, n3;
printf("enter n1");
scanf("%d", &n1);
printf("enter n2");
scanf("%d", &n2);
printf("enter n3");
scanf("%d", &n3);
int average = n1/3+n2/3+n3/3;
printf("average is : %d", average);
return 0;
}