-
Lenguaje
Pascal
-
Descripción
Usted va a adquirir un disco duro para su computador y el vendedor le ofrece tamaños de disco duro expresados en Terabyte. Para lo cual usted realiza análisis del problema que le permite convertir ese valor en Megabyte y en Gigabyte.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
program TerabytesAMegabytesYGigabytes;
uses crt;
var gigabytes, megabytes, terabytes : real;
begin
write ('Ingresa el valor de terabytes: ');
readln (terabytes);
gigabytes := terabytes*1024;
megabytes := gigabytes*1024;
writeln ('Valor de gigabytes: ', gigabytes:0:6);
writeln ('Valor de megabytes: ', megabytes:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var gigabytes, megabytes, terabytes : real;
begin
write ('Ingresa el valor de terabytes: ');
readln (terabytes);
gigabytes := terabytes*1024;
megabytes := gigabytes*1024;
writeln ('Valor de gigabytes: ', gigabytes:0:6);
writeln ('Valor de megabytes: ', megabytes:0:6);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.