Cout Failing To Compile with Error Box

I wrote this code for the CPP Tutorial 5.5 Question 4:
#include <iostream>

using namespace std;

void loop2(int x)
{
string results;
int i = x;

while (i <= x) {

    results = results + "X";

}

cout << results;
}


int main()

{
    cout << "Read To Go!" << "/n" <<;

    int outer = 1;
    while (outer <= 5)
    {
        // loop between 1 and outer
        int inner = 1;
        while (inner <= outer)
        loop2(5 - inner);
        cout << inner++ << " ";

        // print a newline at the end of each row
        cout << "\n";
        ++outer;
    }

    return 0;
}

But It won’t stop flagging “cout << “Read To Go!” << “/n” <<;” but you see idk why. Can someone plz help me? Ya’ll are my last resort. :slightly_smiling_face:

NOTE: This code is still WIP the issue is it won’t compile not that it isn’t complete.

Remove << from the end of the line.

cout << “Read To Go!” << “/n”;

Also, your second while loop has no block, and the i variable in your function isn’t being incremented.

Try this:
#include

using namespace std;

void loop2(int x)
{
    string results;
    int i = x;

    while (i <= x) {

        results = results + "X";
        i++;
    }

    cout << results;
}


int main()

{
    cout << "Read To Go!" << "/n";

    int outer = 1;
    while (outer <= 5)
    {
        // loop between 1 and outer
        int inner = 1;
        while (inner <= outer) {
            loop2(5 - inner);
            cout << inner++ << " ";

            // print a newline at the end of each row
            cout << "\n";
        }
        
        ++outer;
    }

    return 0;
}