Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- //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.
- class CirclePerimetreAndArea
- {
- static void Main()
- {
- Console.Write("Enter the radius of the circle: ");
- double radius = double.Parse(Console.ReadLine());
- double perimitreCircle = (2 * Math.PI * radius);
- double areaCircle = (Math.PI * (Math.Pow(radius, 2)));
- Console.WriteLine("The perimetre of the circle is: {0:0.00}", perimitreCircle);
- Console.WriteLine("The area of the circle is: {0:0.00}", areaCircle);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement