Question: Hi there, I am writing the bellow code to determine whether the area or perimeter of a rectangle is greater, I have a silly error
Hi there,
I am writing the bellow code to determine whether the area or perimeter of a rectangle is greater, I have a silly error showing up on my code that I cannot tell the reason:
I am getting the right results out of the program, is just that red line under the ; at the end of the program that I need to correct.

int main ()
{
int length, breadth, area, perimeter;
printf("Enter the length and breadh of a rectangle: ", length, breadth);
scanf("%d %d", &length, &breadth);
area = length * breadth;
perimeter = ((length*2)+(breadth*2));
if (area>perimeter)
printf("The area is greater than the perimeter");
else
printf("The Perimeter is greater than the area");
}
Could you please tell me what is the error?
int main() { int length, breadth, area, perimeter; printf("Enter the length and breadh of a rectangle: ", length, breadth); scanf("%d %d", &length, &breadth); area = length * breadth; perimeter = ((length*2)+(breadth*2)); if (area>perimeter) printf("The area is greater than the perimeter"); else printf("The Perimeter is greater than the area"); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
