fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. float base, height, area;
  6.  
  7. printf("Enter base of the triangle: ");
  8. scanf("%f", &base);
  9. printf("Enter height of the triangle: ");
  10. scanf("%f", &height);
  11.  
  12.  
  13. area = (base * height) / 2;
  14.  
  15.  
  16. printf("Area of the triangle = %.2f sq. units", area);
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5308KB
stdin
24
53
stdout
Enter base of the triangle: Enter height of the triangle: Area of the triangle = 636.00 sq. units