15th Jun 2021, 10:29 AM
Zero775
Zero775 - avatar
4 Respostas
+ 2
Yes, that's because you define variable <x> as `int` which is for whole numbers. You need to use `double` if you want to have fractional number. When you define <x> as `double` type, then Convert.ToInt32() is not necessary. double x = ( radius * radius ) * pi;
15th Jun 2021, 11:00 AM
Ipang
+ 2
Ok
15th Jun 2021, 11:03 AM
Zero775
Zero775 - avatar
+ 1
Line 6: Remove the closing curly bracket } Line 18: Convert calculation result to integer int x = Convert.ToInt32( ( radius * radius ) * pi ); Line 24: Add closing curly bracket } P.S. Add C# in the tags ☝ https://code.sololearn.com/W3uiji9X28C1/?ref=app
15th Jun 2021, 10:44 AM
Ipang
+ 1
It gives an output but the output is different from the expected output The expected output is 78.5
15th Jun 2021, 10:56 AM
Zero775
Zero775 - avatar