Compute divisors(n) using our earlier algorithm to get the list of factors. If the list has exactly two elements, 1 and n, report that n is prime; otherwise, report it is not.
Cbse Class 9 Maths Ganita Manjari Part 2 Solutions
class 9 maths ganita manjari part 2 chapter 11 question answer
If the total count of elements in L equals 2 (which means its only factors are 1 and n), report that n is prime.
Otherwise (if it has fewer than 2 elements, such as n = 1 or more than 2), report that n is not prime.
For more NCERT Solutions of Class 9 Maths Ganita Manjari Part 2 Chapter 11 The World of Algorithms Question Answer (2026-27)
https://www.tiwariacademy.com/ncert-solutions/class-9/maths/ganita-manjari-chapter-11/