-
Lenguaje
Pascal
-
Descripción
Dertermine de un conjunto de 300 números enteros lo siguiente:
a) Cuántos son menores a 35.
b) Cuántos son mayores a 100.
c) Cuántos están comprendidos entre 145 y 155.
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
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
program ConjuntoDe300Enteros;
uses crt;
var a, b, c, i, numero : integer;
begin
a := 0;
b := 0;
b := 0;
for i:=1 to 300 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de numero: ');
readln (numero);
if numero<34 then
begin
a := a+1;
end;
if numero>100 then
begin
b := b+1;
end;
if (numero>=145) and (numero<=155) then
begin
c := c+1;
end;
writeln ('Valor de c: ', c);
writeln;
end;
writeln ('Valor de a: ', a);
writeln ('Valor de b: ', b);
writeln ('Valor de b: ', b);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var a, b, c, i, numero : integer;
begin
a := 0;
b := 0;
b := 0;
for i:=1 to 300 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de numero: ');
readln (numero);
if numero<34 then
begin
a := a+1;
end;
if numero>100 then
begin
b := b+1;
end;
if (numero>=145) and (numero<=155) then
begin
c := c+1;
end;
writeln ('Valor de c: ', c);
writeln;
end;
writeln ('Valor de a: ', a);
writeln ('Valor de b: ', b);
writeln ('Valor de b: ', b);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.