Prashnikaप्रश्निका
Code
About
‹ Back to the paper

Question 3(v)

1 mark

Computer ScienceISC 2018 Computer Science Paper 1Short answerImplementation of algorithms to solve problems

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

What is the statement or expression at ?5?

Answer

Answer

$?5? = 10$ (i.e. $num /= 10$) - removes the last digit of num so the loop processes the next digit in the next iteration. (Verified by running the completed function: PalindromeNum(121) and PalindromeNum(1221) return true, PalindromeNum(123) returns false.)