VILL- DEBANDI, AMTA, HOWRAH PIN-711410 Phone-9836357266
32.Sum of all factors :—
#include<stdio.h>
int main()
{
int i,n,r,sum;
printf("enter a value of n ");
scanf("%d",&n);
sum=0;
for(i=1;i<=n;i++)
r=n%i;
if(r==0)
sum=sum+i;
}
printf("%d",sum);
return 0;
No comments:
Post a Comment