0
Please check my code for the code project 1 on c# basics
So i was tryiny to figure out a solution for the code project 1 for c# and my code worked on visual studio but not on sololearn. Any idea why? heres my code : namespace SoloLearn { class Program { static void Main(string[] args) { const double pi = 3.14; double radius; double Area; Console.WriteLine("What is the r"); radius = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(radius); radius = radius * radius; Area = radius * pi; Console.WriteLine("This is the Area"); Console.WriteLine( Area); } } }
3 Réponses
+ 4
Dimitry Aujour your code appears to work on sololearn .. can you explain what error you are speaking of
https://code.sololearn.com/cSjpELKjL5wO/?ref=app
+ 4
Dimitry Aujour there is one slight correction I did see as if you want to enter a decimal number you need to use
Convert.ToDouble(Console.ReadLine());
Not
Convert.ToInt32(Console.ReadLine());
+ 1
That actually helped me bro thank you!