program to print/display all factors of number 'n'.

 //program to print/display all factors of  number 'n'.
void main()
   int number,factors,i;
   printf("enter any positive number\n");
        {                printf("the factors are=%d ",i);
logics in mind:
->enter a number whose factors value you want to find
->we have to go for repetitive process from number 1 to entered number 'number' i.e we divide given number 'number by 1,2,3... and itself. This we can apply using loop as shown above.If we get zero as remainder while dividing then we display that.

No comments:

Post a Comment