A number is called **factor of a number** if the remainder
after the division is 0.In this program,the factors are considered
from the number 2.Division is carried out for every factor and the
remainder is checked.After completing the division,the factor is
incremented by 1.Number is later decremented by dividing the number
by factor.This process continous till the number decrements to 1.

#include < stdio.h > #include < conio.h > void main() { int n,n1,d,f; clrscr(); printf("\n Enter n : "); scanf("%d",&n); f = 2; while ( n != 1) { while ( n % f == 0 ) { n = n / f; printf("\n%d",f); } // while f = f + 1; } // while } // main