thegrudge

Rectangles

Nov 11th, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Globalization;
  4.  
  5. class Rectangles
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Width: ");
  10.         float width = float.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
  11.         Console.Write("Height: ");
  12.         float height = float.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
  13.         Console.WriteLine("Perimeter = {0}", ((width+height)*2));
  14.         Console.WriteLine("Area = {0}", width*height);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment