+ 10

# Area of a circle c# challenge solution

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { const double pi = 3.14; double radius; radius = Convert.ToDouble(Console.ReadLine()); double area = pi * (radius * radius); Console.WriteLine(area); //your code goes here } } }

6th Jul 2021, 5:57 PM
cameron
+ 2
Is it also possible to write the code with ()Â² or ^2? I already know the writing goes like ... (radius * radius) but i am wondering if there is a more easy way of coding it ... Thx ;)
31st Aug 2021, 8:33 AM
FromAlex TotheAnder
+ 3
cameron Thanks!
4th Nov 2021, 9:25 PM
YourMinecraftGuy
+ 1
Yeah theres definitely more ways, this is just a simple plain version for understanding. Possibly, but the ^ operator is not able to be applied to double and int operands normally.
31st Aug 2021, 10:57 AM
cameron
+ 1
YourMinecraftGuy is there a specific part you dont understand? If you really dont understand any of it at all, id suggest startimg the course/program from the start and really reading the information, it really explains in the best possible way you will find online. And perhaps google for short begginner tutorials im order to see how and why certain things get done and placed. Just say if you need more help
3rd Nov 2021, 10:10 AM
cameron
+ 1
20th Apr 2022, 2:59 AM
Abdullah Ishak
+ 1
Why is it radius * radius? That makes no sense to me. You only need to multiply radius and pi together
5th Nov 2022, 11:36 PM
Chris
0
I guess you should use Math.PI constant to avoid floating point precision error by using only Pi with two decimals (or even any other different Pi value)...
6th Jul 2021, 6:13 PM
visph
0
I donÂ´t understand anything...
3rd Nov 2021, 9:32 AM
YourMinecraftGuy
0
Hello I having trouble with the area of the circle project. how do I get all 5 case test at once I already solved all five by one at a time and also by displaying them all at once any tips to help.
27th Nov 2021, 1:34 AM