Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _2D_RectangleArea
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("x1= ");
- var x1 = double.Parse(Console.ReadLine());
- Console.Write("y1= ");
- double y1 = double.Parse(Console.ReadLine());
- Console.Write("x2= ");
- double x2 = double.Parse(Console.ReadLine());
- Console.Write("y2= ");
- double y2 = double.Parse(Console.ReadLine());
- double area = (x1 - x2) * (y2 - y1);
- double perimeter = 2 * ((x1 - x2) + (y2 - y1));
- {
- Console.WriteLine("Area= " + Math.Abs(area));
- Console.WriteLine("Perimeter= " + Math.Abs(perimeter));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement