• Lenguaje

    Pascal

  • Descripción

    Lee un valor N y determina si es múltiplo común de X y Z donde X y Z también se ingresan por teclado.

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

var N, X, Z : integer;
begin
    write ('Ingresa el valor de N: ');
    readln (N);
    write ('Ingresa el valor de X: ');
    readln (X);
    write ('Ingresa el valor de Z: ');
    readln (Z);
    if (X mod N=0) and (Z mod N=0) then
        begin
            writeln ('N es m'#163'ltiplo com'#163'n de X y Z.');
        end
    else
        begin
            writeln ('N no es m'#163'ltiplo com'#163'n de X y Z.');
        end;
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.