Question: Exercise 3: Function Write a function named triangle that accepts an integer parameter representing a size in characters, and prints to the console a right-aligned

Exercise 3:

Function Write a function named triangle that accepts an integer parameter representing a size in characters, and prints to the console a right-aligned right triangle figure whose non-hypotenuse sides are that length. For example, the call of triangle(5); should print the following output:

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

You may assume that the value passed for the size is at least 1. in PHP

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!