Question: I'm currently reading a book that is challenging me to solve some c++ problems. I was able to solve a problem that wanted me to display (#) from 8 symbols down to one. I was able to accomplish this with the following code: 

```
for (int i = 0; i < 8; i++) {

    for (int j = 0; j < (8 - i); j++) {

        cout << "#";

    }

    cout << endl;
}

```

However, now I am trying to count up, going from one (#) to 8 (#); pretty much the opposite of the first problem.

Answer: 
There are multiple ways to achieve this. One way is to set `i` increasing from `0` to `7` and let `j` increase to be less than or equal to `i + 1` every iteration. i.e. (code untested)

```
for (int i = 0; i < 8; i++) {

    for (int j = 1; j <= i + 1 ; j++) {

        cout << "#";

    }

    cout << endl;
}

```
To add to the other answers here, let's not forget the very convenient `std::setfill` command from [`iomanip`](http://www.cplusplus.com/reference/iomanip/setfill/):

```
#define FILL_CHAR '#'
#define COUNT 8

std::cout << "Count up\n";
for (size_t i = 1; i <= COUNT; ++i)
{
    std::cout << std::setfill(FILL_CHAR) << std::setw(i);
    std::cout << FILL_CHAR << std::endl;
}

std::cout << "Count down\n";
for (size_t i=0; i<COUNT; ++i)
{
    std::cout << std::setfill(FILL_CHAR) << std::setw(COUNT-i);
    std::cout << FILL_CHAR << std::endl;
}

```

[Live Demo](http://coliru.stacked-crooked.com/a/1af53c9e2ca802c2)

### Output

```
Count up
#
##
###
####
#####
######
#######
########
Count down
########
#######
######
#####
####
###
##
#

```