+ 1
Why the checker part of my program works but the list part doesn't?
3 Réponses
+ 2
change
for (int j=1;j<=z;j++)
to
for (int j=1;j<z;j++)
you are going past last value stored in current loop getting whatever was left over before.
+ 1
More than likely, it is because your input of x in main doesn't get passed into list so your code isn't solving the correct problem.
0
sorry John Wells sir,
But I don't intend to have an input in my list part.
because it has to check each and every natural number.
if it is perfect, it gets displayed.
if it is not perfect, it doesn't get displayed.
The output of my list is : 1 6 525 ... which is wrong.
the correct output should be 1 6 28 496...