Advertisement
kirililchev3

Rectangle Properties

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