So I have made a program for computing the sum of the factors of the input but the problem is that it doesn't print the sum. I can't see the error in this code so can someone indicate the problem. Thanks.Code:#include <stdio.h> #include <conio.h> main() { int p,N[100] = {0},d,c,E; printf("Input a number: "); scanf("%d",&p); for(d=1,c=0;d<p;d++) { if(p%d==0) { N[c]=d; c++; } } c=0; while(N[c]!=0) { E=E+N[c]; } printf("\n%d",E); }



2Likes
LinkBack URL
About LinkBacks



you missed that point there..

Now I can continue on my life. XD