Typecasting is often necessary when dealing with financial data. Identify the correct syntax to typecast a double to an int using the variables:

ICSE Class 10 Computer Applications PYQ · 2025 Improvement · Section A

1(vi)1 Mark · 2025 · Section A · 2025 Improvement

Typecasting is often necessary when dealing with financial data. Identify the correct syntax to typecast a double to an int using the variables:

int amount; double valueINR

Show SolutionHide Solution↓

int amount = (int) valueINR;

Reason — The correct syntax to typecast a double to an int in Java is by placing (int) before the double variable, which converts it to an integer by removing its decimal part.

← Previous questionNext question →

Browse the free Computer Applications sample bank