Advertisement
VyaraG

CirclePerimetreAndArea

Nov 28th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. //Write a program that reads the radius r of a circle and prints its perimeter and area formatted with 2 digits after the decimal point.
  4.  
  5. class CirclePerimetreAndArea
  6. {
  7.     static void Main()
  8.     {
  9.         Console.Write("Enter the radius of the circle: ");
  10.         double radius = double.Parse(Console.ReadLine());
  11.         double perimitreCircle = (2 * Math.PI * radius);
  12.         double areaCircle = (Math.PI * (Math.Pow(radius, 2)));
  13.         Console.WriteLine("The perimetre of the circle is: {0:0.00}", perimitreCircle);
  14.         Console.WriteLine("The area of the circle is: {0:0.00}", areaCircle);
  15.  
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement