fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5.  
  6. // **************************************************
  7. // Function: calcAreaOfTriangle
  8. //
  9. // Description: Calculates the area of a triangle
  10. //
  11. //
  12. // Parameters: base - base of the triangle
  13. // height - height of the triangle
  14. //
  15. // Returns: area - area of triangle
  16. //
  17. // ***************************************************
  18.  
  19. float calcAreaOfTriangle(float base, float height)
  20. {
  21.  
  22. float area; // area of the triangle
  23.  
  24. // calculate area
  25. // 0.5 * base * height;
  26. printf("The area of the rectangle is: %f", area);
  27. return (area);
  28.  
  29. } //calcAreaOfTriangle
  30.  
  31.  
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0.01s 5292KB
stdin
1
2
stdout
Standard output is empty