1^2 = 1
11^2 = 121
111^2 = 12321
1111^2 = 1234321
11111^2 = 123454321
<?php
for($s=1;$s<=100000;$s=($s*10)+1)
{
echo $s*$s.'</br>';
}
?> using php you can create output in this way too.
<?php
$s=1;$i=1;$j=1;$m=1;$n=1;
echo $s.'</br>';
for($s=2;$s<=5;$s++)
{
$out=$m.$s.$n;
echo $out.'</br>';
$m=$m.++$i;
$n=++$j.$n;
}
?>
No comments:
Post a Comment