/* 2 prime 3 prime 4 2*2 5 prime 6 2*3 24 2*2*2*3 25 5*5 50 2*5*5 */ #include using namespace std; int main() { const int SIZE = 50; bool prime; int fact; for (int count = 2; (count <= SIZE); count++) { int n = count; cout << n <<"\t"; prime = true; fact = 2; while ( fact <= n/2) { if (n % fact == 0 ) { cout << fact<<"*"; n = n/fact; prime = false; } else fact++; }//inner while if (prime) cout <<"PRIME" <