Hello there, I'm just a beginner, so go easy on me pls.
I wrote this code to calculate the tip for each person in a group's separate bill under one single tip bill, but when I execute it I get a weird error? Idk even if its an error. Please help a guy out.
The Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int i,a[50],peo[50],n;
printf("\nEnter the number of people: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\nEnter the bill amount of person %d",i);
scanf("%d",peo[i]);
a[i]=peo[i]/10;
}
printf("\nTip bill for your group: ");
for(i=1;i<=n;i++)
{
printf("\nPerson %d: %d",i,a[i]);
}
printf("\nThanks for support us! Have a great day!");
getch();
}
The Error(?):
d:/coding with the boys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: d:/coding with the boys/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text+0x46): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status