Finding factor of an integer

Factor of a number -

‪#‎include<stdio.h>
#include<conio.h>
void main()
{int n,x,i=1;
printf("\n enter a number \n");
scanf("%d",&n);
printf("factors=");
while (i<=n)
{x=n%i;
if(x==0)
{printf("%d,",i);
i++;
}
else
{i++;
}
}
getch();
return;
}


lets try this in your PC ......

Post a Comment

0 Comments