Hi, I was told to make a perfect number program in C. We began the semester less than a month ago, so we are using nothing very complicated, but I am having trouble getting it to work. It is supposed to have no input..just output and list all perfect numbers between 1 and LIMIT, which equals 10,000. Can someone show me how I could possibly do this? Your help is greatly appreciated!!!
Just make sure you don't use void main(), since main never should be void. main is 'special', and the same rules, regarding void, does not apply to main. On some special systems void main is allowed, but a good thumb rule is to always define a return value, even though you may not use it. Under the C99 standard, int main(void) is actually the only acceptable (together with argc, argv of course), but the following code is ok: