OK so I'm fairly new to c# in the big scheme of things. I have encountered one of the first things I'm not 100% sure on how to overcome. At the moment I have a program that asks the user to input a number. This is fine if the user inputs something that can be classified as a double. However, I am unsure how to work around fractions and equations, ie; (5*3)+12 with my code looking like...
Console.Write("Enter an equation: ");
double ans = Convert.ToDouble(Console.Readline());
Console.WriteLine("The answer is " + ans)
This doesn't compute with int or double, also I'm aware that the answer to the example given is a integer, however I want it to be classified as a Double so I can get an exact answer when the equation isn't as clean. How would I get around doing this?