Hey I got this assignment and got an error halfway through but don't know what is it it said:

Error Declaration syntax error in function main()

btw this is a really basic code
so here's the code.

#include <stdio.h>
#include <conio.h>

float circumference(int);
int area_tri(int,int);
int area_rec(int,int);
float area_sqr(int);
int menu();

int main()
{
int choice=0,r;

menu();
if(choice==1)
  {
    printf("Enter radius: ");
    scanf("%d",&r);
    printf("The circumference is %f", circumference(r));
  }
float circumference(int r)
{
    float area;
    area = 3.14*r*r;
    return (area);
}

int menu()
{
    printf("What shape would want the area of?\n Enter [1]Circle\n[2]Rectangle\n[3]Square\n[4]Triangle\n");
    scanf("%d",&choice);
    return (choice);
}
getch();
return 0;
}

Please use code tags and proper formating.

The problem, don't define your function inside of main.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.