Fandom

Scratchpad

PLE:Unidad21Ejercicio15

219,460pages on
this wiki
Add New Page
Discuss this page0 Share
/*
Programa:       Ejercicio15.cpp
Fecha:          09/10/2007
Descripción:    Operadores lógicos a nivel de bit.
*/
#include <iostream>
using namespace std;

void main()
{
        int n1, n2, res;

        cout << "Introduzca un numero ";
        cin >> n1;

        cout << "Introduzca otro numero ";
        cin >> n2;

        res = n1 & n2;
        cout << "\nEl resultado de n1 & n2 = " << dec << res << hex << '\t' << res;

        res = n1 | n2;
        cout << "\nEl resultado de n1 | n2 = " << dec << res << hex << '\t' << res;

        res = n1 ^ n2;
        cout << "\nEl resultado de n1 ^ n2 = " << dec << res << hex << '\t' << res;

        // Hacemos una pausa antes de acabar
        cin.ignore();
        cin.get();
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random wikia