What is the most efficient algorithm to print all unique combinations of factors of a positive integer. For example if the given number is 24 then the output should be
bool isprime(int n){ for(int i=2; i<=sqrt(n); i++) if(n%i==0) return false; return true; } void printprime(int n){ int i,j,y=n; while(y%2==0){ cout<<"2 * "; y/=2; } for(i=3; i<=sqrt(y); i+=2){ while(y%i==0){ cout<2) cout< done; for(i=2; i