so i have this program...simple thing. it just gives the base factors and every other factors to a number. it all works fine, except it wont do the last line of code and terminate. i checked all the while loops, and none of them are infinite.
here is the code
#include <iostream>
using namespace std;
int main()
{
int x, y, z;
cout << "enter number to get its factors" << endl;
cin >> y;
z = y;
x = 0;
cout << "base factors are: ";
while (y != 1)
{
x = 2;
while (y%x != 0)
{
x++;
}
cout << x << "; ";
y = y/x;
}
cout << endl;
x = 1;
cout << "normal factors are: ";
while (z != 1)
{
while (z%x != 0)
{
x++;
}
cout << x << "; ";
x++;
}
cout << " done " << endl;