|    
			
				27/09/2003, 11:30
			
			
			  | 
  |   |  |  |  |  Fecha de Ingreso: septiembre-2003 Ubicación: Lima 
						Mensajes: 68
					 Antigüedad: 22 años, 1 mes Puntos: 0 |  | 
  |  Ahora en JavaScript :     
Código:
  <html>
<head>
<script language="JavaScript">
function DecToBin()
{
var numero,suma,digito,exponente;
numero = FormX.txtValue.value;
suma = 0;
exponente = 1;
do
{
digito = numero % 2;
numero = Math.floor(numero / 2);
suma = suma + digito * exponente;
exponente = exponente * 10;
}while(numero > 0);
document.write("El numero binario es: " + suma);
}
</script>
</head>
<body>
<form name="FormX">
Ingresa un numero decimal 
<input type="text" name="txtValue">
<input type="button" value="Enviar" onClick="DecToBin()" >
</form>
</body>
</html>
    |