#include<stdio.h> #include<stdlib.h> int main() { int i,j,k,c,sum; int a[1005]; for(i=6; i<=1000; i++) { c=0; sum=0; for(j=1; j<i; j++) { if(i%j == 0) { a[c++]= j; sum += j; } } if(sum == i) { printf("%d its factors are ",i); for(k=0; k<c-1; k++) { printf("%d,",a[k]); } printf("%d\n",a[c-1]); } } system("pause"); return 0; }