Fandom

Scratchpad

PLE:Unidad2Ejercicio13

215,811pages on
this wiki
Add New Page
Discuss this page0 Share

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.

/*
Programa:       Ejercicio13.cpp
Fecha:          09/10/2007
Descripción:    Utiliza los operadores de desplazamiento
                para multiplicar por 2, 4 y 8
*/
#include <iostream>
using namespace std;

void main()
{
        int n;

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

        n <<= 1;
        cout << "Numero por 2 es = " << n << endl;

        n <<= 1;
        cout << "Numero por 4 es = " << n << endl;

        n <<= 1;
        cout << "Numero por 8 es = " << n << endl;

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

Also on Fandom

Random wikia