+1 (315) 557-6473 

Easy to understand display triangle in C++ assignment sample

Is your display triangle in C++ assignment giving you sleepless nights? We offer high-quality solutions at affordable fees. If you doubt the quality to expect from us, go through the provided display triangle in C++ assignment sample and see the quality of solutions we offer to other students.

Display a Triangle in C++ Assignment Sample

Write a program that displays a right-angled triangle using * character. It should look like

*
**
***
****
*****

This is an incredibly basic C++ programming assignment, we can help with far more advanced ones as well.

Solution:

triangle.cpp

#include
using namespace std;

int main(int agrc, char* agrv[])
{
// Declare the variable
int i, j;
i = j = 0;
// Code need to test
for (i = 1; i <= 5; i++)
{
for (j = 1; j <= i; j++)
cout << “*”;
cout << endl;
}

return 0;
}