First, Visual Studio is just an IDE , it helps develop, it does not run, it does not have who understand nothing.
Second, the code executes what was ordered, the computer "understands" what the programmer ordered. Who has to understand what he is doing is the programmer.
There are several ways to resolve this. The question does not make it very clear what you need to do so I'll answer what I think you want.
You need to consider the culture to be used for printing it.
It's also better to use a TryParse()
since you are not sure that a value will be typed can be converted.
I took advantage of and updated the code.
using static System.Console;
using static System.Math;
using System.Globalization;
namespace Uri_CSharp {
public class URI {
public static void Main(string[] args) {
var texto = ReadLine();
double raio;
if (double.TryParse(texto, out raio)) {
double area = Pow(raio, 2) * 3.14159;
WriteLine(area.ToString("F4", new CultureInfo("pt-BR")));
}
}
}
}
See running on dotNetFiddle and on CodingGround .
You can define the default culture for a thread , so runtime considers it instead of what is configured on the computer:
Thread.CurrentThread.CurrentCulture = new CultureInfo("pt-BR");