Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main()
- {
- Console.WriteLine("Enter a random whole number for rectangle's width: ");
- int width = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter a random whole number for rectangle's height: ");
- int height = int.Parse(Console.ReadLine());
- //calculations
- int area = width * height;
- Console.WriteLine("The rectangle's area is: " + area);
- int perimeter = (2 * width) + (2 * height);
- Console.WriteLine("The rectangle's perimeter is: " + perimeter);
- }
Advertisement
Add Comment
Please, Sign In to add comment