// File powers.cpp #include #include using namespace std; int main() { int x, x2, x3; cout << endl; cout << "Value " << "Square " << "Cube" << endl; cout << "===== " << "====== " << "=====" << endl; for(x = 0; x <= 10; x++) { x2 = x * x; x3 = x * x * x; cout << setw(4) << right; cout << x << " "; cout << setw(6) << right; cout << x2 << " "; cout << setw(6) << right; cout << x3 << endl; } cout << endl; return EXIT_SUCCESS; } // Output: // //Value Square Cube //===== ====== ===== // 0 0 0 // 1 1 1 // 2 4 8 // 3 9 27 // 4 16 64 // 5 25 125 // 6 36 216 // 7 49 343 // 8 64 512 // 9 81 729 // 10 100 1000