Try this
using System;
public class Program
{
public static void Main()
{
double equation = 25 + -2 * 3 / 14d;
Console.WriteLine(equation);
}
}
The issue is that you are doing your operations with integers (whole numbers) so the result will be an integer that you cast as a double. What you need to do is specify that you division operation is done on a float or double so the answer to the division part will not be a whole number. You can also do this with 14.0
or 14f
but it is better to stick to the same data type to avoid conversion issues later on.
You can test your code here: https://dotnetfiddle.net/Tlws6e