double x = 14.7;
int y = x;double x = 14.7;
int y = (int) x;int x = 14;
double y = x;int result = 13 - 3 * 6 / 4 % 3;
double answer = 13 / 5;
Console.WriteLine("13 / 5 = " + answer);
The output is
13 / 5 = 2.0
The programmer intends the output to be
13 / 5 = 2.6
Which of the following replacements for the first line of code will not fix the problem?
double answer = (double) 13 / 5;double answer = 13 / (double) 5;double answer = 13.0 / 5;double answer = 13 / 5.0;double answer = (double) (13 / 5);Suppose that addition and subtraction had higher precedence than multiplication and division. Then the expression
2 + 3 * 12 / 7 - 4 + 8
would evaluate to which of the following?