fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. float a * b * c
  6. a = 0.5;
  7. b = 10.1;
  8. c = 12.2;
  9. printf("Enter base of the triangle : 10.1\n");
  10. scanf("%f", &base);
  11. printf("Enter height of the triangle : 12.1\n");
  12. scanf("%f", &height);
  13. area = a * (b * c);
  14. printf("Area is : %f\n", area);
  15. return 0;
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:5:10: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
  float a * b * c
          ^
prog.c:5:12: error: ‘b’ undeclared (first use in this function)
  float a * b * c
            ^
prog.c:5:12: note: each undeclared identifier is reported only once for each function it appears in
prog.c:5:16: error: ‘c’ undeclared (first use in this function)
  float a * b * c
                ^
prog.c:6:2: error: expected ‘;’ before ‘a’
  a = 0.5;
  ^
prog.c:10:15: error: ‘base’ undeclared (first use in this function)
  scanf("%f", &base);
               ^~~~
prog.c:12:15: error: ‘height’ undeclared (first use in this function)
  scanf("%f", &height);
               ^~~~~~
prog.c:13:2: error: ‘area’ undeclared (first use in this function)
  area = a * (b * c);
  ^~~~
prog.c:13:9: error: ‘a’ undeclared (first use in this function)
  area = a * (b * c);
         ^
stdout
Standard output is empty