Advertisement
bacco

Rectangle Properties

May 22nd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RectangleProperties
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             var a = double.Parse(Console.ReadLine());
  10.             var b = double.Parse(Console.ReadLine());
  11.  
  12.             var perimeter = a * 2 + b * 2;
  13.             var area      = a * b;
  14.             var diagonal  = Math.Sqrt(a * a + b * b);
  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
Advertisement