- 1

Area of a Circle in Test Case #2 for C# is bugged!

The code below is my code for the question, please copy and paste it into the code of C#: Area of a Circle project. Almost all test cases are correct except for Test Case #2 where there is tons of bugs! static void Main(string[] args) { const double pi = 3.14; double radius; radius = Convert.ToInt32(Console.ReadLine()); double output = pi * radius * radius; Console.WriteLine(output); }

21st Oct 2021, 1:24 PM
BoyTheFather
2 Réponses
+ 2
Radius is of type double – therefore convert the input to to double (not to integer)
21st Oct 2021, 2:10 PM
Lisa
Lisa - avatar
0
Thanks!
21st Oct 2021, 11:24 PM
BoyTheFather