![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
21/10/2003, 14:27
|
![Avatar de Blag](http://static.forosdelweb.com/customavatars/avatar41843_1.gif) | | | Fecha de Ingreso: septiembre-2003 Ubicación: Lima
Mensajes: 68
Antigüedad: 21 años, 4 meses Puntos: 0 | |
Ahora en D++ ![Policia](http://static.forosdelweb.com/fdwtheme/images/smilies/cop.png) :
Código:
newvar numero,suma,digito,exponente,respuesta,aux,bye;
screenput "Ingresa un numero decimal: ";
screenin numero;
suma = 0;
exponente = 1;
do while numero >= 1;
digito = numero % 2;
numero = int(numero / 2);
aux = digito * exponente;
suma = suma + aux;
exponente = exponente * 10;
loop
screen;
screenput "El numero binario es: ";
screenput suma;
|