Advertisement
Guest User

Soal Test Nomer 4

a guest
Nov 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. $y = 30;
  2.     for($x=2;$x<=$y;$x++)
  3.         {
  4.             $bilPrima = true;
  5.             for($z=2; $z<$x;$z++)
  6.                 {
  7.                     if($x%$z == 0){
  8.                         $bilPrima = false;
  9.                     }
  10.                 }
  11.             if($bilPrima){
  12.                 echo $x." ";
  13.             }
  14.                    
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement