BubaLazi

CalculateTiangleArea

Jul 7th, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7.  
  8.  
  9. namespace ConsoleApp1
  10. {
  11.     class Program
  12.     {
  13.  
  14.  
  15.         static void Main()
  16.         {
  17.             double width=double.Parse(Console.ReadLine());
  18.             double height = double.Parse(Console.ReadLine());
  19.             double area = GetTriangleArea(width,height);
  20.             Console.WriteLine(area);
  21.         }
  22.        
  23.         static double GetTriangleArea( double width, double height)
  24.         {
  25.            return width * height / 2;
  26.  
  27.         }
  28.        
  29.        
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment