...

/

Solution Review: Display a Right-Angle Triangle

Solution Review: Display a Right-Angle Triangle

Let's see the detailed solution review of the challenge given in the previous lesson.

We'll cover the following...

Solution #

Press + to interact
#include <iostream>
using namespace std;
int main() {
cout << "& & & & & &" << endl;
cout << "& & & & &" << endl;
cout << "& & & &" << endl;
cout << "& & &" << endl;
cout << "& &" << endl;
cout << "&";
}

Explanation

We use cout along with the insertion operator << to print text on the console. ...