This is a bit harder.
Don't work on this while your manager is around.
A positive integer is called a "perfect number" if it is equal to the sum of all of its positive divisors, excluding itself. For example, 6 is the first perfect number because 6 = 3 + 2 + 1. The next is 28 = 14 + 7 + 4 + 2 + 1. There are four perfect numbers less than 10000.
Instructions:
a) Write an xbasic program to find all four of the perfect numbers.
b) Display your answer in a message box on screen. Show the divisors
for each perfect number, so we can easily check your sums.
c) Post your solution by attaching the "exported" script to your reply here.
d) Have fun.
Bookmarks