--%>

Print the factors of each perfect number

An integer number is said to be a perfect number if its factors, including 1 (but not the number itself), sum to be the number. For example, 6 is a perfect number because 6 = 1+ 2+ 3. Write a function perfect that determines if parameter number is a perfect number. Use this function in a program that determines and prints all the perfect numbers between 1 and 1000. Print the factors of each perfect number to confirm that the number is indeed perfect. Challenge the power of your computer by testing numbers much larger than 1000. 

 

   Related Questions in Programming Languages

  • Q : Data type conversion Data type

    Data type conversion: Conversion of one data type into the other data type. Two kind of conversion that is, A) Implicit Conversion: This is automatically taken care

  • Q : Write a function Write a function that

    Write a function that takes an integer value and returns the number with its digits reversed. For example, given 7631, the function should return 1367.

  • Q : Define Constant Constant : It is the

    Constant: It is the memory block where value can be stored once although can’t modify later on throughout program execution. Example: const int pi =3.14;

  • Q : Explain Object reference Object

    Object reference: It is a reference to an object. Languages other than Java employ terms like pointer or address or. It is significant to keep the difference clear between an object and its reference. The variable like argo

    Q : Explain Package declaration Package

    Package declaration: It is a declaration employed to name a package. This should be the first item in the source file, preceding any import statements. For example,     pa

  • Q : Define the term Peripheral devices

    Define the term Peripheral devices: It is the devices attached to a computer, like disk drives, printers, mice, and so forth.

  • Q : Explain the way to handle the mapping

    Explain the way to handle the mapping form.

  • Q : ASP.NET Session handling How to set

    How to set Session time out in ASP.NET. I tries changing in config file but still facing issue. Please help..

  • Q : State Cout and Cin Cout: This is an

    Cout: This is an object of ostream_withassign class stated in iostream.h header file

  • Q : Define the term Scheduler Define the

    Define the term Scheduler: The portion of the Java Virtual Machine (abbreviated as JVM) which is responsible for managing the threads.