• Lenguaje

    Pascal

  • Descripción

    Lea un número entero positivo. Debe determinar si el número es de una cifra, dos cifras, tres cifras o más de tres cifras.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
program NumeroDe123OMasCifras;
uses crt;

var numero : integer;
begin
    write ('Ingresa el valor de numero: ');
    readln (numero);
    if (numero>=0) and (numero<10) then
        begin
            writeln ('Una cifra');
        end;
    if (numero>=10) and (numero<100) then
        begin
            writeln ('Dos cifras');
        end;
    if (numero>=100) and (numero<1000) then
        begin
            writeln ('Tres cifras');
        end;
    if numero>=1000 then
        begin
            writeln ('M'#160's de tres cifras');
        end;
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.