How to calculate the area of trapezium in Java

1 Answer

0 votes
using System;

public class Program
{
	public static void Main(string[] args)
	{
		double base1 = 4.0;
		double base2 = 7.0;
		double height = 5.0;

		double area = (base1 + base2) / 2.0 * height;

		Console.Write("Area of Trapezium = " + area);
	}
}






/*
run:
   
Area of Trapezium = 27.5
   
*/

 



answered May 8, 2023 by avibootz
edited May 8, 2023 by avibootz

Related questions

1 answer 260 views
1 answer 255 views
1 answer 205 views
1 answer 223 views
1 answer 203 views
1 answer 192 views
1 answer 243 views
...