how to print below format using only one for loop. Please tell is it possible to do this ?
1
12
123
1234
12345
1234
123
12
1
There are hundreds of ways to do it. This is just one:
for($i=-4; $i<5; $i++)
print substr('12345', 0, 5-abs($i))."\n";
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments