Prime number Program in PHP

Advertisements

Palindrome Number in PHP Fibonacci Series Program in PHP

Prime number Program in PHP

Here we can write php program to find number is prime or not using for loop. Here also same concept apply like C programming.

Program to find prime numbers in between a Range

<?php

error_reporting(E_ALL);

$num =23;

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>;
}

?>

Output

	
Prime Number : 2
Prime Number : 3
Prime Number : 5
Prime Number : 7
Prime Number : 11
Prime Number : 13
Prime Number : 17
Prime Number : 19
Prime Number : 23

Palindrome Number in PHP Fibonacci Series Program in PHP

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements