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