Write round number from a to b
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Program: C_cisla.pas
File exe: C_cisla.exe
File ubuntu: C_cisla
Program: C_cisla.pas
File exe: C_cisla.exe
File ubuntu: C_cisla
Write round number from a to b. Numbers a,b are inputs.
{ C_CISLA.PAS Copyright (c) TrSek alias Zdeno Sekerak } { Vytvorte program ktory nacita dve cele cisla (a,b) } { a vypise vsetky cele cisla od a po b (Pozor!!! a<b alebo a>b). } { } { Datum:23.05.2004 http://www.trsek.com } program cele_cisla; var a,b:integer; i:integer; begin WriteLn('Vypisem vsetky cele cisla od a po b.'); Write('Zadaj cele cislo a='); ReadLn(a); Write('Zadaj cele cislo b='); ReadLn(b); WriteLn('Poradie celych cisel je:'); if(a<b)then begin for i:=a to b do WriteLn(i); end else begin for i:=a downto b do WriteLn(i); end; WriteLn('Koniec'); ReadLn; end.