prime factorization
<p>I am trying to calculate the prime factors of a number using trial method. I am trying the following method:-</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;conio&gt;
#include&lt;math&gt;
using namespace std;
int main()
{
int i,j,count=0;
for(i=1;i&lt;=126;i++)
{
    if(126%i==0)
    {
        if(i==1)
        {
            cout&lt;&lt;1&lt;&lt;endl;
        }
        else if(i==2)
        {
            cout&lt;&lt;2&lt;&lt;endl;
        }
        else
        {
            for(j=2;j&lt;i;)
            {
                if(i%j==0)
                {
                    break;
                }
                else
                {
                    j++;
                    count++;
                }
            }
            if(count==i-2)
            {
                cout&lt;&lt;i&lt;&lt;endl;
            }
        }
    }
}
return 0;
}
</code></pre>

<pre>Output:-
1
2
3
9</pre>

<p>The problem is :- it is not working properly. I would be glad if you guys would help me. Please just give some hints and NO solutions.</p>
