Sunday 10 March 2013

C/C++ Program to Find the Sum of Perfect Numbers

  A perfect number is a positive integer that is equal to the sum of its proper positive divisors that is, the sum of its positive divisors excluding the number itself. For example 28 is a perfect number. The proper positive divisors of 28 are 1, 2, 4, 7 and 14 which adds up to 28. In this post I have added C/C++ Programs to print  the first N perfect numbers. The sum of these perfect numbers is also found by the program. For large values of N the program will not generate any output.

 Figure Below Shows a Sample Output



1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete