Fundamentalen

Rectangles

Mar 14th, 2014
843
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.  
  3. class Rectangles
  4. {
  5.     static void Main()
  6.     {
  7.         Console.Write("Width = ");
  8.         double width = double.Parse(Console.ReadLine());
  9.         Console.Write("Height = ");
  10.         double height = double.Parse(Console.ReadLine());
  11.  
  12.         double perimeter = (2 * width) + (2 * height);
  13.         double area = width * height;
  14.  
  15.         Console.WriteLine("Perimeter of rectangle is " + perimeter);
  16.         Console.WriteLine("Area of rectangle is " + area);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment