C program to check given number is perfect number or not

1. Online Compilers - Compile & Run your C/C++ programs:

✅ Online Compilers

2. Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





What is perfect number?

A number is considered as perfect number when it satisfies the below conditions.

  • It should be a positive number
  • When the sum of it’s divisors (excluding that number) are equal to that number

Example for perfect numbers:


6, 28, 496, 8128

Description:

1 + 2 + 3 = 6


1 + 2 + 4 + 7 + 14 = 28

C program to check given number is perfect number or not:

Please refer below C program to check whether given number is perfect number or not.

Output:

Please enter a number to check perfect number

28

Entered number 28 is a perfect number

 

1. Online Compilers - Compile & Run your C/C++ programs:

✅ Online Compilers

2. Ask your questions or clarify your/others doubts from,

✅ Online Discussion Forums by Fresh2Refresh.com





Share this website !!!
Facebook Twitter Linkedin