Task: write a function to calculate the area of a square, rectangle, circle. My code is right. IDK why I am getting this error complete error
#include<stdio.h>
#include<math.h>
int square();
float airclearea();
int rectangle();
int main(){
int s,r1,r2;
float a;
printf("Enter the side of square : ");
scanf("%d",&s);
printf("Enter the side of rectangle");
scanf("%d %d",&r1,&r2);
printf("Enter the radius of circle");
scanf("%f",&a);
printf("%d",square(s));
printf("%d",rectangle(r1,r2));
printf("%f",airclearea(a));
return 0;
}
int square(int s){
return s*s;
}
int rectangle(int r1, int r2){
return r1*r2;
}
float airclearea(float a){
return 3.14*a*a;
}
int square();means it takes no arguments. Update those signatures or move those functions abovemain()& get rid of prototypes. Don't share images of text/code/logs.int square(); float airclearea(); int rectangle();have different meanings in C and C++ — are you perchance using a C++ compiler? In C++, the functions are declared to take no arguments, and the later definitions contradict those declarations. In C, which is the tagged language, the three statements declare the functions but do not specify a prototype. My best guess is that you're using a C++ compiler to compile C code; that doesn't work. Even in C, it is horribly sloppy practice not to declare the functions with full prototypes with the correct argument lists.