kirililchev3

Get Triangle Area

May 31st, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P06_Calculate_Triangle_Area
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double width = double.Parse(Console.ReadLine());
  10.             double height = double.Parse(Console.ReadLine());
  11.             double area = GetTriangleArea(width,height);
  12.             Console.WriteLine(area);
  13.            
  14.         }
  15.         static double GetTriangleArea(double width, double height)
  16.         {
  17.             return width * height / 2;
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment