If statement , For และ While loop statement....?

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: If statement , For และ While loop statement....?

Re: If statement , For และ While loop statement....?

โดย Ann2524 » 15/04/2024 10:48 am

ขอสแตนเม้นท์ย้อนหลังทางอีเมล์3เดือนคะ

If statement , For และ While loop statement....?

โดย 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]
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]

While Loop statement คือการทำงานซ้ำโดยไม่ทราบจำนวนรอบที่แน่นอนเหมือนกับ 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]




แนบไฟล์
If statement.PNG
If statement.PNG (9.02 KiB) Viewed 3444 times
for statement.PNG
for statement.PNG (3.01 KiB) Viewed 3444 times
pass,break,continue loop 1.PNG
pass,break,continue loop 1.PNG (12.26 KiB) Viewed 3444 times
pass,break,continue loop.PNG
pass,break,continue loop.PNG (10.45 KiB) Viewed 3444 times
while statement.PNG
while statement.PNG (3.08 KiB) Viewed 3444 times
ผลลัพธ์ Break loop 1.PNG
ผลลัพธ์ Break loop 1.PNG (1.98 KiB) Viewed 3444 times
ผลลัพธ์ Break loop.PNG
ผลลัพธ์ Break loop.PNG (2.04 KiB) Viewed 3444 times
ผลลัพธ์ Continue loop 1.PNG
ผลลัพธ์ Continue loop 1.PNG (3.18 KiB) Viewed 3444 times
ผลลัพธ์ Continue loop.PNG
ผลลัพธ์ Continue loop.PNG (2.74 KiB) Viewed 3444 times
ผลลัพธ์ for statement.PNG
ผลลัพธ์ for statement.PNG (1.65 KiB) Viewed 3444 times
ผลลัพธ์ If statement.PNG
ผลลัพธ์ If statement.PNG (1.31 KiB) Viewed 3444 times
ผลลัพธ์ pass loop.PNG
ผลลัพธ์ pass loop.PNG (2.91 KiB) Viewed 3444 times
ผลลัพธ์ while statement.PNG
ผลลัพธ์ while statement.PNG (3.04 KiB) Viewed 3444 times
รูปแบบการเขียน for.PNG
รูปแบบการเขียน for.PNG (4.58 KiB) Viewed 3444 times
รูปแบบการเขียน if.PNG
รูปแบบการเขียน if.PNG (7.44 KiB) Viewed 3444 times

ข้างบน