-
Lenguaje
Pascal
-
Descripción
Dados como datos dos variables de tipo entero, obtenga el resultado de la siguiente función:
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
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
program Funcion100X100X100X;
uses crt, math;
var NUM, x, y : integer;
begin
write ('Ingresa el valor de NUM: ');
readln (NUM);
write ('Ingresa el valor de x: ');
readln (x);
y := 0;
if NUM=1 then
begin
y := 100.0*x;
end;
if NUM=2 then
begin
y := power(100,x);
end;
if NUM=3 then
begin
y := 100.0 div x;
end;
writeln ('Valor de y: ', y);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt, math;
var NUM, x, y : integer;
begin
write ('Ingresa el valor de NUM: ');
readln (NUM);
write ('Ingresa el valor de x: ');
readln (x);
y := 0;
if NUM=1 then
begin
y := 100.0*x;
end;
if NUM=2 then
begin
y := power(100,x);
end;
if NUM=3 then
begin
y := 100.0 div x;
end;
writeln ('Valor de y: ', y);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.