programming-examples/php/Basics/PHP program to find HCF of two numbers.php

37 lines
488 B
PHP
Raw Permalink Normal View History

2019-11-18 14:44:36 +01:00
<?php
if(isset($_POST['submit']))
{
$num1=$_POST['number1'];
$num2=$_POST['number2'];
function hcf($i1,$i2)
{
if($i2!=0)
{
return hcf($i2,$i1%$i2);
}
else
{
return $i1;
}
}
$hcfofnumber=hcf($num1,$num2);
}
?>