[55 views]

Perfect number is a positive integer equal to the sum of its proper divisors. Sum of its proper divisor excludes the Number itself. Ex. For number 6, the divisors are 1, 2, 3 and 6. Now if we take sum of 1, 2, 3 and exclude the number itself (i.e. 6), the sum is 6. Hence, 6 is a perfect number. 6 is the smallest Perfect Number.

Let's check another number:

Input: 28

Divisors of 28: 1, 2, 4, 7, 14, 28

Sum of Divisors excluding 28: 1+2+4+7+14=28

Output: 28 is Perfect Number

Our Quiz prepared by Experts Helps you identify your knowledge in Algorithms. Everyone should atleast attempt this Quiz Once.

- How To Find Compound Interest Using C++ Program
- Can a where Clause be used along with a Truncate command
- Top Project Management Platforms Every Business Team should Know - Slack, Zoho, Teamwork Projects
- How to convert the number into Characters in a sentence using C++
- What Are Computer Algorithms and How Do They Work?