PRASHNIKAप्रश्निका
‹ Back to the paper

Fill in the blanks marked ?1?, ?2? ... so that the code works.

What is the statement or expression at ?3?

Computer Science20181 markShort answer

Answer

Answer

AI
$?3? = s$ (i.e. $digit = num - s$) - subtracting $s$ ($=f*10$) from num extracts the last digit of num, without using the modulus operator.
Implementation of algorithms to solve problems

From ISC 2018 Computer Science Paper 1, question 3(iii).