VelizarAvramov

12. Rectangle Properties

Nov 15th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace Demo
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             double width = double.Parse(Console.ReadLine());
  11.             double height = double.Parse(Console.ReadLine());
  12.  
  13.             double perimeter = 2 * (width + height);
  14.             double area = width * height;
  15.             double diagonal = Math.Sqrt(width * width + height * height);
  16.  
  17.             Console.WriteLine($"{perimeter}");
  18.             Console.WriteLine($"{area}");
  19.             Console.WriteLine($"{diagonal}");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment