C++:Program to find prime factor of given no.


#include<iostream.h>
#include<conio.h>
int main(){
int i=2,n;
cout<<"Enter no.to find its prime"<< "factor"<<endl;
cin>>n;
while(n>1)
  {
   if(n%i == 0)
{    cout<<i<<" ";
     n=n/i;
    }
   else{
    i++;
  }
}
}
                   < Happy Coding>

Popular Posts

Top 10 Web Sites Every Programmer Should Visit Daily

C++: Huffman Coding using STL

What is "namespace" and why do we use it?