‹ Back to the paper
Ram and Hari are coder friends, who are debating effective usage of memory while using variables…
Ram and Hari are coder friends, who are debating effective usage of memory while using variables, without compromising on precision of values. Help them on identifying the right data type to use, for the following data:
(a)[0.5]
Population of a country
(b)[0.5]
Interest rate in a bank account
Answer
Answer (a)
AIlong (a population count can exceed the range of int, so a larger integer type is used).
Answer (b)
AIfloat (a decimal value where double's extra precision is not needed, saving memory).
From ISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024), question 36.