Advertisement
savovaap_

Area of Trapezoid

Mar 29th, 2023
688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     float a, b, h;
  6.     float S;
  7.  
  8.     printf("Enter a = ");
  9.     scanf("%f", &a);
  10.     printf("Enter b = ");
  11.     scanf("%f", &b);
  12.     printf("Enter h = ");
  13.     scanf("%f", &h);
  14.  
  15.     S = 0.5 * (a + b) * h;
  16.  
  17.     printf("Area of the trapezoid - %.2f", S);
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement