Proyect C# Area of a Circle | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
- 1

Proyect C# Area of a Circle

Hi, im doing the proyects of C# but i can't do the Area of a Circle proyect, I do it by this way, please help me with the answer and why is that const double pi = 3.14; double radius; 5 double radiusPow = Math.Pow(radius, 2); double result = pi * radiusPow; Console.WriteLine(result);

2nd Jul 2021, 2:29 AM
Mariana Gil
1 Antwort
+ 1
Your code needs to take the radius as input instead of giving a direct value double radius =Convert.ToDouble(Console.ReadLine()); //double radius = 5
2nd Jul 2021, 2:43 AM
Simba
Simba - avatar