#include <stdio.h>
int main ()
{
/* variable definition: */
double length, width, area, perimeter;
double average;
/* Read the inputs from the user */
printf("Enter the length of the rectangle:12.5 "); printf("Enter the width of the rectangle:12.5 "); if (length >= && width >= )
area = length * width;
perimeter = 2 * (length + width);
printf("Area: %lf\n" , area
); printf("Perimeter: %lf\n" , perimeter
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbiAoKQp7Ci8qIHZhcmlhYmxlIGRlZmluaXRpb246ICovCmRvdWJsZSBsZW5ndGgsIHdpZHRoLCBhcmVhLCBwZXJpbWV0ZXI7CmRvdWJsZSBhdmVyYWdlOwoKLyogUmVhZCB0aGUgaW5wdXRzIGZyb20gdGhlIHVzZXIgKi8KcHJpbnRmKCJFbnRlciB0aGUgbGVuZ3RoIG9mIHRoZSByZWN0YW5nbGU6MTIuNSAiKTsKc2NhbmYoIiVsZiIsICZsZW5ndGgpOwpwcmludGYoIkVudGVyIHRoZSB3aWR0aCBvZiB0aGUgcmVjdGFuZ2xlOjEyLjUgIik7CnNjYW5mKCIlbGYiLCAmd2lkdGgpOwppZiAobGVuZ3RoID49ICAmJiB3aWR0aCA+PSApCmFyZWEgPSBsZW5ndGggKiB3aWR0aDsKcGVyaW1ldGVyID0gMiAqIChsZW5ndGggKyB3aWR0aCk7CgpwcmludGYoIkFyZWE6ICVsZlxuIiAsIGFyZWEgKTsKcHJpbnRmKCJQZXJpbWV0ZXI6ICVsZlxuIiAsIHBlcmltZXRlcik7CnJldHVybiAwOwp9
prog.c: In function ‘main’:
prog.c:14:12: error: invalid operands to binary >= (have ‘double’ and ‘void *’)
if (length >= && width >= )
^~ ~~~~~~~~
prog.c:14:28: error: expected expression before ‘)’ token
if (length >= && width >= )
^
prog.c:14:1: error: label ‘width’ used but not defined
if (length >= && width >= )
^~
prog.c:7:8: warning: unused variable ‘average’ [-Wunused-variable]
double average;
^~~~~~~
prog.c:11:1: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf", &length);
^~~~~~~~~~~~~~~~~~~~~
prog.c:13:1: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf", &width);
^~~~~~~~~~~~~~~~~~~~