0

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;
}

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by gerard4143
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.