-
Lenguaje
Pascal
-
Descripción
Introduzca dos números para imprimir la suma, el producto, la diferencia, el cociente y el resuido de los dos números.
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
32
33
34
35
36
37
38
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
32
33
34
35
36
37
38
program SumaProductoDiferenciaCocienteYResuido;
uses crt;
var a, b, cociente, diferencia, producto : integer;
var resuido, suma : integer;
begin
write ('Ingresa el valor de a: ');
readln (a);
write ('Ingresa el valor de b: ');
readln (b);
suma := a+b;
producto := a*b;
diferencia := a-b;
if b=0 then
begin
cociente := 0;
end
else
begin
cociente := a div b;
end;
if b=0 then
begin
resuido := 0;
end
else
begin
resuido := a mod b;
end;
writeln ('Valor de cociente: ', cociente);
writeln ('Valor de diferencia: ', diferencia);
writeln ('Valor de producto: ', producto);
writeln ('Valor de resuido: ', resuido);
writeln ('Valor de suma: ', suma);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var a, b, cociente, diferencia, producto : integer;
var resuido, suma : integer;
begin
write ('Ingresa el valor de a: ');
readln (a);
write ('Ingresa el valor de b: ');
readln (b);
suma := a+b;
producto := a*b;
diferencia := a-b;
if b=0 then
begin
cociente := 0;
end
else
begin
cociente := a div b;
end;
if b=0 then
begin
resuido := 0;
end
else
begin
resuido := a mod b;
end;
writeln ('Valor de cociente: ', cociente);
writeln ('Valor de diferencia: ', diferencia);
writeln ('Valor de producto: ', producto);
writeln ('Valor de resuido: ', resuido);
writeln ('Valor de suma: ', suma);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.