‹ Back to the paper
Question 35
1 mark
Computer ScienceISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024)Short answerPrimitive values, Wrapper classes, Types and casting
Answer the following question.
The following statement will generate a compile time error. This can be rectified in 2 different…
The following statement will generate a compile time error. This can be rectified in 2 different ways, without losing precision of price. Write these statements.
float price = 17.99;Answer
Answer
float price = 17.99f;
or
float price = (float) 17.99;