Created
December 12, 2016 16:38
-
-
Save rajvanshipradeep15/aceff002c7c9243c2ace973ac2877c5a to your computer and use it in GitHub Desktop.
star program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// your code goes here | |
// problem 01 solution | |
for($i=5;$i>=1;$i--) | |
{ | |
echo str_repeat('*',$i); | |
echo "\n"; | |
} | |
echo "---------------------"; | |
// problem 02 solution | |
echo "\n"; | |
echo "\n"; | |
for($i=1;$i<=5;$i++) | |
{ | |
echo str_repeat('*',$i); | |
echo "\n"; | |
} | |
echo "\n"; | |
echo "--------------------------"; | |
$j=1; | |
for($i=5;$i>=1;$i--) | |
{ | |
echo str_repeat(" ",$i-1); | |
echo str_repeat('*',$j++); | |
echo "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment