Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- class CircleAreaRadius
- {
- static void Main()
- {
- //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.
- Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
- Console.Write("Enter r (radius) of a circle: ");
- double r = double.Parse(Console.ReadLine());
- Console.WriteLine("The circle Perimeter is: {0:N2}", 2 * Math.PI * r);
- Console.WriteLine("The cirlce Area is: {0:N2}", Math.PI * r * r);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment