VelizarAvramov

12. Rectangle Properties

Nov 28th, 2019
135
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 _12._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.             double perimeter = (2 * width) + (2 * height);
  13.             double area = width * height;
  14.             double diagonal = Math.Sqrt((width * width) + (height * height));
  15.  
  16.             Console.WriteLine($"{perimeter}");
  17.             Console.WriteLine($"{area}");
  18.             Console.WriteLine($"{diagonal}");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment