- static void Main(string[] args)
- {
- WriteLine("What is the radius of your circle: ");
- WriteLine("The area of your circle is: " + circleArea(Double.Parse(ReadLine())).ToString());
- ReadKey();
- }
- static double circleArea(double radius = 5.00)
- {
- return Math.PI * (radius * radius);
- }
So far the code I have is working and it is able to calculate the area of a circle; however, I need to have the main method pass an integer variable (radius) with an optional default value. I thought I had it by adding =5 to my second method, but that wasn't it.
Any help would be appreciated.

Rajanikant HawaldarRank #110 · 20.4K reputationPosted Mar 9, 2020, 9:09 PM EDT
Eric Kraus9 reputationPosted Mar 9, 2020, 11:08 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Mar 10, 2020, 4:38 AM EDT