1. Engineering
  2. Computer Science
  3. using the c programming language an integer number is said...

Question: using the c programming language an integer number is said...

Question details

Using the C Programming Language:

An integer number is said to be a perfect number if its factors, including 1 (but not the number itself), sum to 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.

Note that the function perfect should be a boolean function (returns a value of 'true' i.e. 1 or 'false' i.e. 0).

Example:

The perfect numbers between 1 and 1000 are:

6 is a perfect number; It's factors are = 1, 2, 3

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution