โดย Patcharanan.0399 » 17/04/2018 11:12 am
If statement ควบคุมการทำงานโดยใช้การแบ่งบล๊อคและการย่อหน้าแทนการใช้เครื่องหมาย {...}
[attachment=0]รูปแบบการเขียน if.PNG[/attachment] [attachment=13]If statement.PNG[/attachment] [attachment=4]ผลลัพธ์ If statement.PNG[/attachment]
For Loop statement คือการทำงานซ้ำจนกว่าจะพบว่าเป็นเท็จ โดยกำหนดช่วงการทำงานให้ใช้งานคู่กับ ' in '
[attachment=1]รูปแบบการเขียน for.PNG[/attachment] [attachment=14]for statement.PNG[/attachment] [attachment=5]ผลลัพธ์ for statement.PNG[/attachment]
Loop Control Statement ทำหน้าที่เปลี่ยนลำดับการทำงาน ได้แก่ Pass , Break , Continue
[attachment=11]pass,break,continue loop.PNG[/attachment] [attachment=3]ผลลัพธ์ pass loop.PNG[/attachment] [attachment=8]ผลลัพธ์ Break loop.PNG[/attachment] [attachment=6]ผลลัพธ์ Continue loop.PNG[/attachment]
While Loop statement คือการทำงานซ้ำโดยไม่ทราบจำนวนรอบที่แน่นอนเหมือนกับ For Loop และจะทำงานจนกว่าเงื่อนไขจะเป็นเท็จ
[attachment=10]while statement.PNG[/attachment] [attachment=2]ผลลัพธ์ while statement.PNG[/attachment]
Loop Control Statement จะทำหน้าที่เช่นเดียวกับ Loop Control Statement ใน For Loop
[attachment=12]pass,break,continue loop 1.PNG[/attachment] [attachment=9]ผลลัพธ์ Break loop 1.PNG[/attachment] [attachment=7]ผลลัพธ์ Continue loop 1.PNG[/attachment]
- แนบไฟล์
-
- If statement.PNG (9.02 KiB) Viewed 3444 times
-
- for statement.PNG (3.01 KiB) Viewed 3444 times
-
- pass,break,continue loop 1.PNG (12.26 KiB) Viewed 3444 times
-
- pass,break,continue loop.PNG (10.45 KiB) Viewed 3444 times
-
- while statement.PNG (3.08 KiB) Viewed 3444 times
-
- ผลลัพธ์ Break loop 1.PNG (1.98 KiB) Viewed 3444 times
-
- ผลลัพธ์ Break loop.PNG (2.04 KiB) Viewed 3444 times
-
- ผลลัพธ์ Continue loop 1.PNG (3.18 KiB) Viewed 3444 times
-
- ผลลัพธ์ Continue loop.PNG (2.74 KiB) Viewed 3444 times
-
- ผลลัพธ์ for statement.PNG (1.65 KiB) Viewed 3444 times
-
- ผลลัพธ์ If statement.PNG (1.31 KiB) Viewed 3444 times
-
- ผลลัพธ์ pass loop.PNG (2.91 KiB) Viewed 3444 times
-
- ผลลัพธ์ while statement.PNG (3.04 KiB) Viewed 3444 times
-
- รูปแบบการเขียน for.PNG (4.58 KiB) Viewed 3444 times
-
- รูปแบบการเขียน if.PNG (7.44 KiB) Viewed 3444 times
[size=115][b]If statement[/b] ควบคุมการทำงานโดยใช้การแบ่งบล๊อคและการย่อหน้าแทนการใช้เครื่องหมาย {...}
[attachment=0]รูปแบบการเขียน if.PNG[/attachment] [attachment=13]If statement.PNG[/attachment] [attachment=4]ผลลัพธ์ If statement.PNG[/attachment]
[b]For Loop statement[/b] คือการทำงานซ้ำจนกว่าจะพบว่าเป็นเท็จ โดยกำหนดช่วงการทำงานให้ใช้งานคู่กับ ' [color=#FF0000]in [/color]'
[attachment=1]รูปแบบการเขียน for.PNG[/attachment] [attachment=14]for statement.PNG[/attachment] [attachment=5]ผลลัพธ์ for statement.PNG[/attachment]
8O Loop Control Statement ทำหน้าที่เปลี่ยนลำดับการทำงาน ได้แก่ Pass , Break , Continue
[attachment=11]pass,break,continue loop.PNG[/attachment] [attachment=3]ผลลัพธ์ pass loop.PNG[/attachment] [attachment=8]ผลลัพธ์ Break loop.PNG[/attachment] [attachment=6]ผลลัพธ์ Continue loop.PNG[/attachment]
[b]While Loop statement[/b] คือการทำงานซ้ำโดยไม่ทราบจำนวนรอบที่แน่นอนเหมือนกับ For Loop และจะทำงานจนกว่าเงื่อนไขจะเป็นเท็จ
[attachment=10]while statement.PNG[/attachment] [attachment=2]ผลลัพธ์ while statement.PNG[/attachment]
8O Loop Control Statement จะทำหน้าที่เช่นเดียวกับ Loop Control Statement ใน For Loop
[attachment=12]pass,break,continue loop 1.PNG[/attachment] [attachment=9]ผลลัพธ์ Break loop 1.PNG[/attachment] [attachment=7]ผลลัพธ์ Continue loop 1.PNG[/attachment]
[/size]