-
Lenguaje
Pascal
-
Descripción
Se ingresa una hora y sus minutos y obtiene la hora del minuto siguiente.
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
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
program MinutoSiguiente;
uses crt;
var hora, hora_siguiente, minuto, minuto_siguiente : integer;
begin
write ('Ingresa el valor de hora: ');
readln (hora);
write ('Ingresa el valor de minuto: ');
readln (minuto);
minuto_siguiente := minuto+1;
hora_siguiente := hora;
if minuto_siguiente=60 then
begin
minuto_siguiente := 0;
hora_siguiente := hora_siguiente+1;
end;
if hora_siguiente=24 then
begin
hora_siguiente := 0;
end;
writeln ('Valor de hora siguiente: ', hora_siguiente);
writeln ('Valor de minuto siguiente: ', minuto_siguiente);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var hora, hora_siguiente, minuto, minuto_siguiente : integer;
begin
write ('Ingresa el valor de hora: ');
readln (hora);
write ('Ingresa el valor de minuto: ');
readln (minuto);
minuto_siguiente := minuto+1;
hora_siguiente := hora;
if minuto_siguiente=60 then
begin
minuto_siguiente := 0;
hora_siguiente := hora_siguiente+1;
end;
if hora_siguiente=24 then
begin
hora_siguiente := 0;
end;
writeln ('Valor de hora siguiente: ', hora_siguiente);
writeln ('Valor de minuto siguiente: ', minuto_siguiente);
writeln;
write ('Presiona una tecla para terminar . . . ');
readkey;
end.