Prime number in php

 <!DOCTYPE html>

<html>

<body>




<?php

//See is a list of primer number below 

$num =200;


for( $j = 2; $j <= $num; $j++ )

{

for( $k = 2; $k < $j; $k++ )

{

if( $j % $k == 0 )

{

break;

}


}

if( $k == $j )

echo "Prime Number : ", $j, "<br>";

}

?>


Comments

Popular posts from this blog

My Sql Query ..

Interview question laravel.