-
Lenguaje
Pascal
-
Descripción
Ingresar dos números por teclado el programa debe establecer si ambos son pares o impares.
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 DosNumerosParesOImpares;
uses crt;
var a, b : integer;
begin
write ('Ingresa el valor de a: ');
readln (a);
write ('Ingresa el valor de b: ');
readln (b);
if (a mod 2=0) and (b mod 2=0) then
begin
writeln ('Ambos son pares');
end;
if (a mod 2=1) and (b mod 2=1) then
begin
writeln ('Ambos son impares');
end;
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var a, b : integer;
begin
write ('Ingresa el valor de a: ');
readln (a);
write ('Ingresa el valor de b: ');
readln (b);
if (a mod 2=0) and (b mod 2=0) then
begin
writeln ('Ambos son pares');
end;
if (a mod 2=1) and (b mod 2=1) then
begin
writeln ('Ambos son impares');
end;
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.