Skip to content

Instantly share code, notes, and snippets.

@luisenriquecorona
Created September 26, 2017 19:28
Show Gist options
  • Save luisenriquecorona/873bf40b53852f5006f8bffbbe07edd9 to your computer and use it in GitHub Desktop.
Save luisenriquecorona/873bf40b53852f5006f8bffbbe07edd9 to your computer and use it in GitHub Desktop.
Formulario mayor de 3 numeros
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="http://cdn.jsdelivr.net/foundation/5.0.2/css/foundation.min.css" />
<script src="http://cdn.jsdelivr.net/foundation/5.0.2/js/modernizr.js"></script>
</head>
<title> Algoritmo para Valor Mayor</title>
<head>
<script language="JavaScript">
function algoritmo()
{
var a, b, c, mayor;
a = parseFloat (document.formulario.a.value);
b = parseFloat (document.formulario.b.value);
c = parseFloat (document.formulario.c.value);
mayor=a;
if(mayor<b)
mayor=b;
if(mayor<c)
mayor=c;
document.formulario.mayor.value = mayor;
}
</script>
</head>
<body>
<form name="formulario">
<table style="text-align: left; margin-left: auto; margin-right: auto;" border="1" cellpadding="1" cellspacing="1">
<tbody>
<tr><td>Ingrese el valor de a</td><td><input name="a"></td></tr>
<tr><td>Ingrese el valor de b</td><td><input name="b"></td></tr>
<tr><td>Ingrese el valor de c</td><td><input name="c"></td></tr>
<tr align="center">
<td colspan="2" rowspan="1">
<input value="Procesar" type="button" class="small radius button" onclick="algoritmo();">
<input type="reset" class="small radius button">
</td>
</tr>
<tr>
<td>Valor de mayor</td>
<td><input name="mayor"></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment