#include #include using namespace std; /* Output these 10 lines: 0 01 012 0123 01234 012345 0123456 01234567 012345678 0123456789 The variable "row" does two jobs: 1. It keeps count of which row you're currently outputting, so you don't output too many rows. 2. It also controls the length (i.e., the number of X's) of each row. */ int main() { int nrows {10}; for (int row {0}; row < nrows; ++row) { //Inner loop outputs a row of row+1 digits, all on same line. for (int col {0}; col <= row; ++col) { cout << col; } cout << "\n"; } return EXIT_SUCCESS; }