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 177 views
1 answer 166 views
1 answer 133 views
1 answer 138 views
1 answer 125 views
1 answer 114 views
1 answer 153 views
...