Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » C++ » Solved Programs on C++ » Triangle Code

C++ code to print triangle using for loop

This program uses three for loops to print Triangle of *. Program can be done in other loops like while & do-while loops

using namespace std;

int main()
    for(int i=5; i>0; i--)
     for(int j=0; j<=(5-i)*2+1; j++)
    return 0;    

Printing Triangle of * in C++

printing triangle in C++