Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write an expression that calculates rectangle’s perimeter and area by given width and height.
- using System;
- class PerimeterArean
- {
- static void Main()
- {
- Console.Write("Enter width: ");
- string a = Console.ReadLine();
- double width = double.Parse(a);
- Console.Write("Enter width: ");
- string b = Console.ReadLine();
- int height = int.Parse(b);
- Console.WriteLine("Perimeter = " + 2 * (width + height) + ". Area = " + (width * height) + ".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement