#include #include using namespace std; /* Output these 10 lines: X XX XXX XXXX XXXXX XXXXXX XXXXXXX XXXXXXXX XXXXXXXXX XXXXXXXXXX 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 X's, all on the same line. for (int col {0}; col <= row; ++col) { cout << "X"; } cout << "\n"; } return EXIT_SUCCESS; }