the program isworking alright but the area or output is not coreect
i tried everything but it is not working properly
#include<stdio.h>
#include<conio.h>
int square(int a);
float circle(float b);
int rectangle(int c, int d);
int main()
{
int a,b,c,d;
printf("enter side of square");
scanf("%d ",&a);
printf("enter radius of circle ");
scanf("%d ",&b);
printf("enter sides of recatngle ");
scanf("%d ",& c);
scanf("%d",& d) ;
printf("%d \n\t",square);
printf("%d \n\t",circle);
printf("%d \n\t",rectangle);
getch();
return 0;
}
// functions //
int square (int a){
return a*a;
}
float circle(float b){
return 3.14*b*b;
}
int rectangle(int c, int d){
return c*d;
}
the output which is coming while running this program for area of rectangle circle and square is not correct
>Solution :
printf("%d \n\t",square);
printf("%d \n\t",circle);
printf("%d \n\t",rectangle);
Is incorrect. To call the functions you need to use () and pass the parameters. You also need to use the correct printf formats to display parameters of different types.
printf("%d \n\t",square(a));
printf("%f \n\t",circle(b));
printf("%d \n\t",rectangle(c,d));