we have to print a pattern similar to that of a right-angle triangle, such as:
*
**
***
****
- You have to take an integer type variable, and the input of the variable will define the length of the triangle.
- You have to declare another Boolean variable.
- When the value of Boolean is 1 i.e. True, the pattern will be printed as shown above. ☝️
- But if the value of Boolean is 0 or false, then the triangle will be printed upside down. 👇
****
***
**
*