1 / 4

Loop Bag.2

Loop Bag.2. Oleh: Ahmad Ramadhani, S.Kom. While. while (condition) statement Contoh. Contoh2. Proses loop: 1. User assigns a value to n 2. The while condition is checked (n>0). At this point there are two posibilities : * condition is true: statement is executed (to step 3)

Download Presentation

Loop Bag.2

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. LoopBag.2 Oleh: Ahmad Ramadhani, S.Kom

  2. While while (condition) statement Contoh. Contoh2. Proses loop: 1. User assigns a value to n 2. The while condition is checked (n>0). At this point there are two posibilities: * condition is true: statement is executed (to step 3) * condition is false: ignore statement and continue after it (to step 5) 3. Execute statement: cout << n << ", "; --n; (prints the value of n on the screen and decreases n by 1) 4. End of block. Return automatically to step 2 5. Continue the program right after the block: print FIRE! and end program.

  3. Do While do statement while (condition); Contoh. Contoh 2.

  4. GoTo xxxx : Statement Increase; If (kondisi) goto xxxx; Contoh.

More Related