Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _2D_RectangleArea
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.Write("x1= ");
  14. var x1 = double.Parse(Console.ReadLine());
  15. Console.Write("y1= ");
  16. double y1 = double.Parse(Console.ReadLine());
  17. Console.Write("x2= ");
  18. double x2 = double.Parse(Console.ReadLine());
  19. Console.Write("y2= ");
  20. double y2 = double.Parse(Console.ReadLine());
  21. double area = (x1 - x2) * (y2 - y1);
  22. double perimeter = 2 * ((x1 - x2) + (y2 - y1));
  23. {
  24. Console.WriteLine("Area= " + Math.Abs(area));
  25. Console.WriteLine("Perimeter= " + Math.Abs(perimeter));
  26. }
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement