Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- //Write an expression that calculates the area of a trapezoid by give sides a, b and height h.
- class AreaOfTrapezoid
- {
- static void Main()
- {
- Console.Write("a = ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("b = ");
- int b = int.Parse(Console.ReadLine());
- Console.Write("h = ");
- int h = int.Parse(Console.ReadLine());
- double area = (a + b) * h / 2;
- Console.WriteLine();
- Console.WriteLine("Trapeoid Area = {0}", area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement