Advertisement
martinvalchev

Rectangle_Properties

Jan 31st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Rectangle_Properties
  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.  
  12.  
  13.             double diagonal = (Math.Sqrt((Math.Pow(width, 2)) + (Math.Pow(height, 2))));
  14.             double area = width * height;
  15.             double perimeter = (2 * width) + (2 * height);
  16.  
  17.             Console.WriteLine(perimeter);
  18.             Console.WriteLine(area);
  19.             Console.WriteLine(diagonal);
  20.  
  21.  
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement