Skip to main content

Prime Number Using PHP In Bangla





Code:

<form action method="post">

Enter Number: <input type="text" name="num" />

<input type="submit" value="Submit" name="submit" />

</form>



<?php

if(isset($_POST['submit'])){

$num = $_POST['num'];

$prime = 1;

for($i=2;$i<$num;$i++){

if($num%$i==0){

$prime=0;

break;



}



}

if($prime==1){

print "The number is prime";



}

else {

print "The number is not prime";



}



}

?>

Comments

Popular posts from this blog

PHP Type Casting in Bangla Language

Code: <?php print $x =(int)78.9; print "<br />"; print $y = (float)87; $z = (array)90; print "<br />"; print $z[0]; ?>

PHP Function Part 3 in Bangla Language

Code: <?php function xyz($x, $y){ $z = $x + $y; return $z; } $a = xyz(10,20); print $a; function x() { $y[] = "abc"; $y[] = "xyz"; $y[] = "efg"; return $y; } list($a,$b,$c) = x(); print "<br />"; print $a." ".$b." ".$c; ?>

Export and Imporrt MySQL Database