How to calculate the area of trapezium in C#

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 173 views
1 answer 164 views
1 answer 124 views
1 answer 132 views
1 answer 120 views
1 answer 113 views
1 answer 149 views
...