Venciity

[Jumpstart C#] Console HMWRK - Area And Perimeter

Jan 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8.  
  9. namespace AreaAndPerimeter
  10. {
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.            
  16.  
  17.             Console.Write("Radius = ");
  18.             double radius = Double.Parse(Console.ReadLine());
  19.  
  20.             double pi = 3.14159d;
  21.  
  22.             double perimteter = 2 * pi * radius;
  23.             double area = pi * radius * radius;
  24.  
  25.             Console.WriteLine("Perimeter: {0:F4}", perimteter);
  26.             Console.WriteLine("Area: {0:F4}", area);
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment