Triangle elevated left

Draw staircase structure (Left side elevated triangle) problem-1

Staircase structure (Left side elevated triangle)


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

 

Input

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


Output

Print staircase with symbol '*' and spaces.


*

* *

* * *

* * * *



Solution

<?php

$n=6;

 

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

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

  if($j<=$i) {

   echo '*';

  }

  else {

   echo ' ';

  }

  if($j==$n) {

   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 for the day

There is only one difference between Dream and Aim. Dream requires effortless sleep and Aim requires sleepless efforts. Sleep for Dreams and wake up for Aims.

Swami Vivekanand
Polls
Which device you use most for facebook application?
Laptop/PC
20%

 


Android
58%

 


IOS
12%

 


Blackberry
10%

 


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