Writes only even number from interval (a,b)
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Program: Parne.pas
File exe: Parne.exe
Program: Parne.pas
File exe: Parne.exe
Writes only even number from interval (a,b).
{ PARNE.PAS Copyright (c) TrSek alias Zdeno Sekerak } { Vytvorte program ktory nacita dve cele cisla a,b (a<b), a vypise } { vsetky parne cisla z intervalu. } { } { Datum:23.05.2004 http://www.trsek.com } program cele_cisla_parne; var a,b:integer; i:integer; begin WriteLn('Vypisem vsetky parne cisla z intervalu.'); Write('Zadaj cele cislo a='); ReadLn(a); Write('Zadaj cele cislo b='); ReadLn(b); WriteLn('Parne cisla z intervalu su:'); for i:=a to b do begin if( round(i/2) = i/2 ) then WriteLn(i); end; WriteLn('Koniec'); ReadLn; end.