Prashnikaप्रश्निका

Implementation of algorithms to solve problems - ISC Class 12 Computer Science Questions with Answers, Page 2

24 past-paper questions on Implementation of algorithms to solve problems from ISC Class 12 Computer Science papers (2026-2018), newest first, in full. Questions 21-24 are on this page, 20 to a page. Tap "Show answer" under a question to see its answer.

Practise these questions with filters
2018 · 1 mark · Short answerOpen: What is the statement or expression at ?5?

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

What is the statement or expression at ?5?
Show answer

Answer

AI
$?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.)
2018 · 1 mark · Short answerOpen: What is the statement or expression at ?3?

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

What is the statement or expression at ?3?
Show 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.
2018 · 1 mark · Short answerOpen: What is the statement or expression at ?1?

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

What is the statement or expression at ?1?
Show answer

Answer

AI
$?1? = 0$ - rev is initialised to 0 before the reversed digits are accumulated into it.
2018 · 1 mark · Short answerOpen: What is the statement or expression at ?2?

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

What is the statement or expression at ?2?
Show answer

Answer

AI
$?2? = f * 10$ (i.e. $s = f*10$) - since $f = num/10$ is num with its last digit removed (integer division), multiplying it back by 10 gives num with its last digit replaced by 0.

Questions on other pages on Implementation of algorithms to solve problems

Read the notes

Other Computer Science chapters