Posts

Showing posts with the label perfect numbers

Perfect numbers | Rosetta Code | #8

URL to the problem page:  http://rosettacode.org/wiki/Perfect_numbers A perfect number is a positive integer that is the sum of its proper positive divisors excluding the number itself. Equivalently, a perfect number is a number that is half the sum of all of its positive divisors (including itself). It is not known if there are any odd perfect numbers (any that exist are larger than 10 2 0 0 0 ). The number of known perfect numbers is 50 (as of September, 2018), and the largest known perfect number contains over 46 million decimal digits. #include   <iostream> using   namespace   std ; int   main () {      int  sum, result =  0 ;     cout <<  "First 4 perfect numbers are:"  << endl;      for  ( int  i =  1 ; result <=  3 ; i++) {       ...
My photo
Ercan Tomac
instagram.com/ercantomac