Fandom

Scratchpad

PLE:Unidad21Ejercicio14

219,332pages on
this wiki
Add New Page
Discuss this page0 Share
/*
Programa:       Ejercicio14.cpp
Fecha:          09/10/2007
Descripción:    Utiliza los operadores de desplazamiento
                para dividir entre 2, 4 y 8
*/
#include <iostream>
using namespace std;

void main()
{
        int n;

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

        n >>= 1;
        cout << "Numero dividido entre 2 es = " << n << endl;

        n >>= 1;
        cout << "Numero dividido entre 4 es = " << n << endl;

        n >>= 1;
        cout << "Numero dividido entre 8 es = " << n << endl;

        // 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