#include // file: pow1.cc // while loops // example for creating a math table int main() { int j = 0; cout << " N N^2 N^3 N^4 N^5 N^6" << endl; while ( j < 10) { j++; cout << j << " " << j*j << " " << j*j*j << " " << j*j*j*j << " " << j*j*j*j*j << " " << j*j*j*j*j*j << endl; } return 0; } Sample output: < pow1 > N N^2 N^3 N^4 N^5 N^6 >1 1 1 1 1 1 >2 4 8 16 32 64 >3 9 27 81 243 729 >4 16 64 256 1024 4096 >5 25 125 625 3125 15625 >6 36 216 1296 7776 46656 >7 49 343 2401 16807 117649 >8 64 512 4096 32768 262144 >9 81 729 6561 59049 531441 >10 100 1000 10000 100000 1000000