Advertisement
Fundamentalen

Trapezoids

Mar 14th, 2014
1,144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. using System;
  2.  
  3. class Trapezoids
  4. {
  5.     static void Main()
  6.     {
  7.         Console.Write("a = ");
  8.         double a = double.Parse(Console.ReadLine());
  9.         Console.Write("b = ");
  10.         double b = double.Parse(Console.ReadLine());
  11.         Console.Write("h = ");
  12.         double h = double.Parse(Console.ReadLine());
  13.  
  14.         double area = ((a + b) / 2) * h;
  15.  
  16.         Console.WriteLine("Area of trapezoid is " + area);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement