C# C# Basics (Retired) Perfect Integers and Doubles

Mytchell Hagan
Mytchell Hagan
1,871 Points

I don't really understand the question.

What?

What's the question?

Quizzes have multiple questions, and the order of the questions get shuffled every time you take the quiz.

Mytchell Hagan
Mytchell Hagan
1,871 Points

int a = 3; int b = 2; double c = 3.5; double y = a / b * c; Submit Answer

1 Answer

andren
andren
28,375 Points

The question is asking you what y equals after the code that is shown is executed. In other words what is the result of this "3 / 2 * 3.5" math equation.

Due to the way math in C# works when you mix integers and doubles the answer is something different from what you would normally expect. Try to figure out the answer using what you learned about math in C# in the previous videos. if you can't figure out the answer then just reply to this post and I'll provide you with the solution.