Dsa
Math
Easy
Perfect Numbers Determination
A perfect number is a positive integer that is equal to the sum of its proper divisors (excluding itself). Write a program that checks if a given integer n is a perfect number.
Input Format:
- A single integer n (1 ≤ n ≤ 10^8).
Output Format:
- Print 'True' if n is a perfect number, otherwise print 'False'.
Example:
Input:
6
Output:
True
(1 + 2 + 3 = 6)
Key concepts
perfect numbersmathnumber theory
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now