-
Lenguaje
Pascal
-
Descripción
Permitir leer dos números N1 y N2 e indicar si uno de los dos divide exactamente al otro, en caso contrario informar que no es posible.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
program DivisionExactaDeN1YN2;
uses crt;
var N1, N2 : integer;
begin
write ('Ingresa el valor de N1: ');
readln (N1);
write ('Ingresa el valor de N2: ');
readln (N2);
if (N1 mod N2=0) or (N2 mod N1=0) then
begin
writeln ('Uno de los dos divide exactamente al otro.');
end
else
begin
writeln ('No es posible.');
end;
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var N1, N2 : integer;
begin
write ('Ingresa el valor de N1: ');
readln (N1);
write ('Ingresa el valor de N2: ');
readln (N2);
if (N1 mod N2=0) or (N2 mod N1=0) then
begin
writeln ('Uno de los dos divide exactamente al otro.');
end
else
begin
writeln ('No es posible.');
end;
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.