Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <?
- define("A", 0);
- define("B", 120);
- echo 'Liczby pierwsze z zakresu od '.A.' do '.B.':<br />';
- for ($n=A; $n<B; $n++) {
- $ilosc=0;
- for ($i=2;$i<=$n/2; $i++) {
- if ($n%$i==0) {
- $ilosc++; break;
- }
- }
- if ($ilosc==0 && $n>1) {echo $n.' ';}
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement