programming-examples/php/Basics/PHP program to find factor of any number.php
2019-11-18 14:44:36 +01:00

17 lines
307 B
PHP

// Write a program to find factor of any number
<?php
if(isset($_POST['sub']))
{ $j=0;
$factor=array();
$num=$_POST['nm1'];
for($i=1;$i<=$num;$i++)
{
if($num%$i==0)
{
$j++;
$factor[$j]=$i;
}
}
}
?>