Ver Mensaje Individual
  #1  
Antiguo 22-04-2017
Daniel2622 Daniel2622 is offline
Miembro
NULL
 
Registrado: abr 2017
Posts: 29
Reputación: 0
Daniel2622 Va por buen camino
Números impares desde 1 hasta 1000

Hola, necesito ayuda con el siguiente ejercicio:
Escribe un programa que imprima en un objeto Memo los números impares desde 1 hasta 1000.

Este es el código que he construido:

Código Delphi [-]
procedure TForm1.BitBtn1Click(Sender: TObject);
var c,n1,n2:Integer;
    a,b:Integer;
    i:Integer;
begin
Memo1.Lines.Clear;
Memo1.Text:='Numeros impares';
if n1then
begin
 a:=1;
 b:=1000;
 end
else
begin
  a:=1000;
  b:=1;
end;
 For i:=a to b do
begin
  c:=1;
  while c<=1000 do
begin
  Memo1.Lines.Add(
  IntToStr(n1)+'  '+IntToStr(n2)+FloatToStr(i mod c)!=0;
end;
  Memo1.Lines.Add('          ');
 end;
end;

Me dice que el operador de relación != es ilegal.

De antemano gracias por su ayuda.
Saludos.
Responder Con Cita