you endl twice which seems wrong after first loop.
just break it down.
you want +
then N dashes, loop it
then + again
then endl
in a loop
{
then | pipe
then N spaces, looped
then pipe again
then endl
} for all the rows
repeat the first line logic here
done.
you do not have this. you have the doubled endl and no | printed after it and no double loop for the rows (one loop down, one loop across each one as I described).
Yeah, I understood what you're saying now the only thing I am having trouble with is putting the pipe on the other side of the rectangle because the column only goes down on one side and does not appear on the other side of the connecting end.
//Draw a single line of fiver uppercase Xs using two kinds of count-controlled loops
#include <iostream>
using namespace std;
you have multiple problems still.
you do not set count1 to zero, so you do not actually write any spaces. to see this, change the space to some other char like * until you get it right.
you did not do a nested loop, so once you set count1 back to zero you only get 1 row that is right. Nesting the loops fixes this but then your end of lines need to be cleaned up.
putting all that together gives something like this.
**note the code tags here. please use them going forward.