6. Maths- part 2
8.) Print all divisors/factors- Brute: 1 se n tak ka loop chalake check divisibility of n with each i Optimal: 1 se sqrt(n) tak ka loop chalado and print i and n/i as per divisibility ----------------------------------------------------------------------------------------------------------------------------- 9.) Prime number check- prime number- has exactly 2 divisors (1 and itself) Brute: 1 se n tak dekhlo, ki it must have exactly 2 divisors... Optimal: 1 se sqrt(n) tak dekhlo, ki it must have exactly 1 divisor...⭐ above methods ki cond true hai toh prime hoga...else not... ----------------------------------------------------------------------------------------------------------------------------- 10.) Prime factors of n: Brute: find all factors of n, then filter out prime numbers out of them. Optimal: finding all factors wale code ko hi modify krdo⭐ ---...