I need help writing a program with this loop. I do not need help with the math part of it. The question is, A perfect # is a # which is the sum of all its divisors except itself. Six is the first perfect #; the only #s which divide 6 evenly are 1,2,3,6 and 6=1+2+3. An abundant # is one which is one less than the sum of its divisors
(12 <1+2+3+4+6); a deficient # is greater than the sum of its divisors (9>1+3).
Write a complete 'C' program which classifies each of the first N integers (where N is entered by the user) as either perfect, abundant, or deficient. The output should be formatted so that the program generates a table.
Here is what I have so far....
# include <stdio.h>
int count, abundant, perfect, deficient, sum=0, num;
printf("Enter a number\n");
printf("ABUNDANT PERFECT DEFICIENT\n");
printf("-------- ------- ---------\n");
while (count <= 20)
for (count=1; count <= 20; count++);
I cannot figure out what to do after this. I am stuck. Please help in anyway possible. I am not asking for anyone to write the program for me. Thanks in advance,