Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Function by : Kadoel Noesa
- Penggunaan : Ganjil(10)
- output : 1-3+5-7+9-11+13-15+17-19
- -->
- <html>
- <head><title> Ganjil </title></head>
- <body>
- <?
- $n=10;
- $a=$n*2;
- $b=1;
- if ($a%2==0)
- {
- echo $b." ";
- for ($s=1; $s<$a-1; $s++)
- {
- echo " - ";
- echo $s+2;
- $s=$s+2;
- echo " + ";
- echo $s+2;
- $s=$s+1;
- if ($s==$a-4)
- {
- break;
- }
- }
- echo " - ";
- echo $s+3;
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement