Perfect Number using loop
Write a C Program to find the perfect numbers below a given number. Here’s simple C Program to find the perfect numbers below a given number in C Programming Language.
Normally, when we work with Numbers, we use primitive data types such as int, short, long, float and double, etc. The number data types, their possible values and number ranges have been explained while discussing C++ Data Types.
Perfect number : :
A perfect numbers is a positive number that equals the sum of its divisors, excluding itself. This is also known as its aliquot sum. At this time, it is unknown how many perfect numbers truly exist in our number system.
While we have discovered 48 perfect numbers, the fact that there are an infinite number of prime numbers leads us to believe that there could be an infinite number of perfect numbers.
Here is source code of the C Program to find the perfect numbers below a given number. The C program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.
SOURCE CODE : :
// C Program to find the perfect number below a given number
printf("\n\n\t ENTER THE UPPER LIMIT: ");
printf("\n\n\t THE PERFECT NUMBER ARE..: ");
sum = 0;
if(n%i == 0)
sum = sum + i;
if (sum == n)
OUTPUT : :
*************** OUTPUT **************
ENTER THE UPPER LIMIT: 10000
THE PERFECT NUMBER ARE..:
If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach upto you in the short interval.
Thanks for reading the post….