
12/09/2008, 12:48
|
 | | | Fecha de Ingreso: abril-2008
Mensajes: 267
Antigüedad: 16 años, 11 meses Puntos: 8 | |
Respuesta: decimales a quebrados ??????? ia lo hice , de una forma , con la tabla miren aki les dejo el code Cita:
<form name="form1" method="post" action="">
Numerados
<input name="nume" type="text" id="nume">
<br>
<br>
Denominador
<input name="deno" type="text" id="deno">
<br>
<br>
............................
<label>
<input type="submit" name="Submit" value="Enviar">
</label>
</form>
<?
function comprobar ($numero) {
for ( $i = 1 ; $i <= 100 ; $i++ ) {
for ( $h = 1 ; $h <= 100 ; $h++ ) {
//echo $i."//".$h . " => " . $i/$h . " , " ;
if( $i/$h == $numero ) {
$chey = $i."/".$h . " = " .$i/$h ;
return $chey ;
exit();
}
} // trmina el segundo for
} // termina el primer for
} // termina la funcion
if( isset($_POST[nume]) and isset($_POST[deno]) ) {
$numero = $_POST[nume]/$_POST[deno] ;
echo comprobar ($numero);
}
?>
weno gracias a todos por su apoio
Última edición por duskrow; 12/09/2008 a las 14:38 |