coasterka

#3RectPerimeterArea

Mar 13th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. static void Main()
  2.         {
  3.             Console.WriteLine("Enter a random whole number for rectangle's width: ");
  4.             int width = int.Parse(Console.ReadLine());
  5.             Console.WriteLine("Enter a random whole number for rectangle's height: ");
  6.             int height = int.Parse(Console.ReadLine());
  7.             //calculations
  8.             int area = width * height;
  9.             Console.WriteLine("The rectangle's area is: " + area);
  10.             int perimeter = (2 * width) + (2 * height);
  11.             Console.WriteLine("The rectangle's perimeter is: " + perimeter);
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment