fork download
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5. /* variable definition: */
  6. double length, width, area, perimeter;
  7. double average;
  8.  
  9. /* Read the inputs from the user */
  10. printf("Enter the length of the rectangle:12.5 ");
  11. scanf("%lf", &length);
  12. printf("Enter the width of the rectangle:12.5 ");
  13. scanf("%lf", &width);
  14. if (length >= && width >= )
  15. area = length * width;
  16. perimeter = 2 * (length + width);
  17.  
  18. printf("Area: %lf\n" , area );
  19. printf("Perimeter: %lf\n" , perimeter);
  20. return 0;
  21. }
Compilation error #stdin compilation error #stdout 0s 4372KB
stdin
Standard input is empty
compilation info
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);
 ^~~~~~~~~~~~~~~~~~~~
stdout
Standard output is empty