1 / 5

Pascal

Pascal. Tsüklid. Tsüklite liigid. määratud korduste arvuga tsükkel (FOR) alustamistingimusega tsükkel (WHILE) lõpetamistingimusega tsükkel (REPEAT). FOR-tsükkel (näide). program tsykkel1; var i: integer; begin for i:=1 to 5 do writeln(i,'. rida'); readln; end.

blair-bell
Download Presentation

Pascal

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pascal Tsüklid

  2. Tsüklite liigid • määratud korduste arvuga tsükkel (FOR) • alustamistingimusega tsükkel (WHILE) • lõpetamistingimusega tsükkel (REPEAT)

  3. FOR-tsükkel (näide) program tsykkel1; var i: integer; begin for i:=1 to 5 do writeln(i,'. rida'); readln; end.

  4. WHILE-tsükkel (näide) program tsykkel2; var pealinn: string; vastus: boolean; begin vastus:=false; while vastus=false do begin writeln('Mis on Läti pealinn? '); readln(pealinn); if pealinn='Riia' then vastus:=true; end; readln; end.

  5. REPEAT-tsükkel (näide) repeat <programmi laused> write('Kas soovid korrata (j/e)? '); readln(vastus); until vastus='e' or vastus='E';

More Related