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 : How would you extract an exact

    How would you extract an exact attribute by using XSLT, from an element into an XML document?

  • Q : Modeling Language for SPIN-Promela

    Modeling Language: The modeling language used for SPIN is called Promela (Process Meta Language). In fact, the name SPIN stands for Simple Promela Interpreter. Promela is a powerful C-like specification language with a variety of synchronization primi

  • Q : Define Comment Comment : It is a piece

    Comment: It is a piece of text proposed for the human reader of a program. The compilers disregard their contents.

  • Q : Define Peer Peer : It is a term

    Peer: It is a term employed of the Abstract Windowing Toolkit (AWT) to refer to the underlying classes which give the platform-specific implementation of the component classes.

  • Q : Describe Layout manager Layout manager

    Layout manager: The object responsible for sharing the accessible space between multiple components in a graphical container.

  • Q : Function of TCHAR used in Windows

    Write down a program to show the function of TCHAR used in Windows Programming?

  • Q : Explain Variable declaration Variable

    Variable declaration: It is the association of a variable with a specific type. It is significant to make a distinction among the declaration of variables of primitive types and such of class types. The variable of primitive type performs as a contain

  • Q : New features of ASP.NET AJAX 4.0

    Explain the new features of the ASP.NET AJAX 4.0?

  • Q : Explain the way to enter element content

    Explain the way to enter element content.

  • Q : Describe Data type Data type : It is a

    Data type: It is a specifier to build memory block of some particular size and kind. C++ provides two kinds of data types: A) Fundamental type: That is not composed

©TutorsGlobe All rights reserved 2022-2023.