0
How to fix pls help
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;
+ 2
Ok
+ 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
+ 1
It gives an output but the output is different from the expected output
The expected output is 78.5