Prime Factorization Problem

It runs but nothing is outputted as response, what wrong?

#include <cstdlib>
#include <iostream>

using namespace std;


int Input;
int Divisor;
int Prime;

int primefunc(int Input)
{
for (Divisor= 1;Divisor<=Input;Divisor++) //Calculates Factors of Input
{
if(Input%Divisor==0)
{
for (Prime= 1;Prime<=Divisor;Prime++)
{
if((Divisor%Prime)>0) //Finds prime factors
{
cout<<Divisor<<"are the prime factors of "<<Input<<endl;
}
else
{
return 0;
}
}
}
else
{
}
}
}
int main()
{
cout<< "Enter a Number:\n";
cin>>Input;
if (Input%1==0)//Checks for a postive integer
{
int primefunc(Input);
}
else
{
cout<< "Please enter a positive integer."<<endl;

}
}
Last edited on
Topic archived. No new replies allowed.