program prog5;
uses crt;
var
x:integer;
begin
clrscr;
x:=1;
while x <= 5 do
begin
gotoxy(10,4+x);write(x,' pato');
x:=x+1;
end;
readln;
end.
OTRO EJEMPLO.
ejemplos:
Program Ej_While;Uses Crt; {El siguiente programa captura una cadena, hasta que se presione la tecla Esc(escape), cuyo ordinal es el #27.} Const Esc = #27;Var nombre : string[30]; tecla : char; cont : word;begin ClrScr; cont:=1; While (tecla<>Esc) do begin Write(cont,' Nombre : '); ReadLn(nombre); inc(cont); tecla:=ReadKey end end.
No hay comentarios:
Publicar un comentario