Fandom

Scratchpad

PLE:Unidad3Ejercicio19

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:       Unidad3Ejercicio19.cpp
Descripción:    Lee un número entero y nos calcula el número de dígitos
*/
#include <iostream>
using namespace std;
void main ()
{
        int n, numDigitos = 0;

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

        while(n != 0)
        {
                n  /= 10;
                numDigitos++;
        }

        cout << "El numero de digitos es = " << numDigitos;

        cin.ignore();
        cin.get();
}

Also on Fandom

Random wikia