Reloj en Turbo Pascal
Publicado por Spanky (1 intervención) el 03/04/2016 00:25:14
Llevo esto del programa y no me sale bien las horas, me marca como si fueran los minutos ¿en que estoy mal?
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
program Reloj;
uses crt;
var seg,min,hor: Integer;
begin
clrscr;
seg:=1;
min:=0;
hor:=0;
repeat
gotoxy (40,12);
write (hor,' : ', min,' : ',seg);
seg:=seg+1;
delay (100);
if seg=60 then
begin
seg:=0;
min:=min+1;
hor:=hor+1;
clrscr;
end;
if min=60 then
min:=0;
if hor=23 then
hor:=0;
until keypressed;
end.
Valora esta pregunta


0