-
Lenguaje
Pascal
-
Descripción
Permite leer 3 valores diferentes e indica cuáles de ellos son iguales o si todos son iguales.
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
28
29
30
31
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
28
29
30
31
program IgualdadDe3Valores;
uses crt;
var a, b, c : real;
begin
write ('Ingresa el valor de a: ');
readln (a);
write ('Ingresa el valor de b: ');
readln (b);
write ('Ingresa el valor de c: ');
readln (c);
if (a=b) and (b=c) then
begin
writeln ('Todos son iguales.');
end;
if (a=b) and (b<>c) then
begin
writeln ('A y B son iguales.');
end;
if (a=c) and (b<>c) then
begin
writeln ('A y C son iguales.');
end;
if (b=c) and (a<>c) then
begin
writeln ('B y C son iguales.');
end;
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var a, b, c : real;
begin
write ('Ingresa el valor de a: ');
readln (a);
write ('Ingresa el valor de b: ');
readln (b);
write ('Ingresa el valor de c: ');
readln (c);
if (a=b) and (b=c) then
begin
writeln ('Todos son iguales.');
end;
if (a=b) and (b<>c) then
begin
writeln ('A y B son iguales.');
end;
if (a=c) and (b<>c) then
begin
writeln ('A y C son iguales.');
end;
if (b=c) and (a<>c) then
begin
writeln ('B y C son iguales.');
end;
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.