Which suffix must be added to the literal 9.99 to assign it to a decimal variable in C#?
Correct answer C. m
Explanation
A real literal such as 9.99 is a double by default, and there is no implicit conversion from double to decimal, so decimal price = 9.99; does not compile. Writing 9.99m makes it a decimal literal. The suffix f marks a float, d an explicit double and L a long integer. The m is often remembered as standing for money.
Answer checked How we write and check questions
Discussion