I've been at this for a while and i can't find an answer, i need the program to display prime when a prime number is entered (while looping infinitely) and i haven't been able to do it.
here is the last part of the code after the data has been entered..
cout << primeFactor << " = ";
for( int i = 2; i <= primeFactor; i++ )
while( primeFactor % i == 0 )
primeFactor /= i;
cout << i;
if( primeFactor > 1 )
cout << " * ";
cout << endl << "Enter another number (0 to stop): ";
Can anyone tell me what i'm missing?