By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,601 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,601 IT Pros & Developers. It's quick & easy.

Help---loop for perfect num

P: 1
An integer number is said to be prefect number if its factors, including 1(but not the number itself), sum to the number.
For example, 6 is a prefect number bcoz 6=1+2+3.
Write a function called prefect that determines if parameter number is a perfect number. Use this function to determine and prints out all the perfect number between 1 to 1000. You also need to print the factors of each
perfect number to comfirm that this number is prefect.


output:
For integers from 1 to 1000.
6 is prefect
the factor of 6 is (including 1) : 1 2 3.
Aug 15 '07 #1
Share this Question
Share on Google+
2 Replies


Ganon11
Expert 2.5K+
P: 3,652
I'd like to refer you both to this thread, which states that you shouldn't ask questions in this forum, and to our FAQ, which dictates how your question should be asked. So far, all you have done is posted an assignment word for word. thescripts members are volunteers who will help you as needed, not slaves who will do your homework for you. Please attempt the problem yourself, show us what efforts you have made to solve the problem yourself, and then we can guide you to the correct answer. I'm going to move this thread to the correct place - please reply again when you have read the above two sources and made an attempt.

MODERATOR
Aug 15 '07 #2

Expert 10K+
P: 11,448
An integer number is said to be prefect number if its factors, including 1(but not the number itself), sum to the number.
For example, 6 is a prefect number bcoz 6=1+2+3.
I don't know what 'bcoz' is but can you tell whether or not 'm' is a factor of 'n'?
Both m and n are integer numbers and you can assume n > m > 0. If you can
you've solved most of your homework already.

kind regards,

Jos
Aug 15 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.