‹ Back to the paper
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
AIfloat price = 17.99f;
or
float price = (float) 17.99;
From ISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024), question 35.