All pastes #896652 Raw Edit

Untitled

public cpp v1 · immutable
·published 2008-02-08 21:17 UTC
rendered paste body
#include <iostream>using namespace std;void binario(int);int main(void) {        int numero;        cout << "Ingrese un numero entero positivo ";        cin >> numero;        if (numero < 0)                 cout <<"Eso no es un numero entero positivo.\n";        else {                cout << numero << " Convertido a binario es: ";                binario(numero);                cout << endl;        }        return 0;}void binario(int numero) {        int resto;        if(numero <= 1) {                cout << numero;                return;        }        resto = numero%2;        binario(numero >> 1);            cout << resto        ;}