- Joined
- Mar 12, 2018
- Posts
- 280
- Reaction
- 217
- Points
- 212
- Age
- 19
Write a c program that will ask the user to enter the length and height of a trapezoid. Find its are. Use the formula
A = ((a+b/2)*h
a = length of base 1
b = length of base 2
h = height of the trapezoid
A = area of trapezoid
Sample output 1
Enter the value of base 1: 0
Invalid value!
Sample output 2
Enter the value of base 1: 2.67
Enter the value of base 2:;-7.98
Invalid value
Sample output 3
Enter the value of base 1: 1.2345
Enter the value of base 2: 5.678
Enter the value of height: 0
Invalid value!
A = ((a+b/2)*h
a = length of base 1
b = length of base 2
h = height of the trapezoid
A = area of trapezoid
Sample output 1
Enter the value of base 1: 0
Invalid value!
Sample output 2
Enter the value of base 1: 2.67
Enter the value of base 2:;-7.98
Invalid value
Sample output 3
Enter the value of base 1: 1.2345
Enter the value of base 2: 5.678
Enter the value of height: 0
Invalid value!