-
Lenguaje
Pascal
-
Descripción
Calcule el total de la compra de 10 productos.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
program TotalDe10Productos;
uses crt;
var i : integer;
var costo_del_producto, total : real;
begin
total := 0;
for i:=1 to 10 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de costo del producto: ');
readln (costo_del_producto);
total := total+costo_del_producto;
writeln;
end;
writeln ('Valor de total: ', total:0:6);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var i : integer;
var costo_del_producto, total : real;
begin
total := 0;
for i:=1 to 10 do
begin
writeln ('PROCESO ', i);
write ('Ingresa el valor de costo del producto: ');
readln (costo_del_producto);
total := total+costo_del_producto;
writeln;
end;
writeln ('Valor de total: ', total:0:6);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.