Inverted left triangle structure

Draw inverted staricase structure (Left side inverted triangle) problem-2

Inverted staircase structure (Left side inverted triangle)


You need to draw a inverted staircase structure i.e. triangle structue which is inverted to left side. It seems to be stand as inverted right angle triangle.

 

Input

Input is given integer N,consider it the height of staircase


Output

Print inverted staircase with symbol '*' and spaces.


* * * * *

* * * *

* * *

* *

*



Solution

<?php

$n=5;

for($i=1;$i<=$n;$i++) {

 for($j=$n;$j>=1;$j--) {

  if($j>=$i) {

   echo '*';

  }

  else {

  echo ' ';

  }

  if($j==1) {

   //echo PHP_EOL;

   echo "<br />";

  }

 }

}

?>

Name
Email
Comments
Back
Funding

We need your support to operate it properly. We have lots of ideas but less fund, so help us with your funding.

Thoughts of the day

Success is not built on success. It's built on failure. It's built on frustration. Sometimes its built on catastrophe.

Sumner Redstone
Polls
Which device you use most for facebook application?
Laptop/PC
17%

 


Android
57%

 


IOS
20%

 


Blackberry
6%

 


Tutorial On Request
Q. Ask us for any tutorial or any thing which helps to build your career better.
Email:
Query: