SlideShare une entreprise Scribd logo
1  sur  12
..
•

•
•




    2
i++    =    i
= i--1 =
  i+       i = i-
1
  i+=5 =   i=
i+i-=5 =
  5        i = i-
5                   3
while
     while (condition)            START
     {
        stmt1;
        stmt2;
        :                                    false
                                 condition
        stmtN;
     }                           true
                                 Statement
•                 stmt1
    stmtN                        Statement
                 condition

                                     END


                                                     4
Counting
              Loop)
•


•
    int i, sum = 0;
    i = 1;
    while (i <= 10)
    {
      sum = sum + i;
      i = i + 1;
    }
    printf("Sum = %dn", sum);


                                 5
while
#include <stdio.h>
int main()
                              while1.c
{                             Hello 1
                              Hello 2
  int i=1;                    Hello 3
  while(i<=10)                Hello 4
  {                           Hello 5
                              Hello 6
    printf("Hello %dn",i);   Hello 7
    i++;                      Hello 8
 }                            Hello 9
                              Hello 10
 getch();
 return 0;
}                                        6
while
      (INFINITY LOOP)
#include <stdio.h>
int main()                    while2.c
{                             Hello 1
  int i=1;                    Hello 2
  while(1)                    Hello 3
  {                           Hello 4
    printf("Hello %dn",i);   Hello 5
    if(i==10)                 Hello 6
                              Hello 7
      break;                  Hello 8
  i++;                        Hello 9
 }                            Hello 10
 getch();
 return 0;
}                                        7
do…while
    do                                  START
    {
       stmt1;
       stmt2;
       :                               Statement1
       stmtN;
    } while (condition);
                                       StatementN

•             stmt1...stmtN
                                true
                                       condition

           condition                        false



•
                                          END
           stmt1...stmtN

                                                    8
do…while
#include <stdio.h>
int main()                    dowhile1.c
{                              Hello 1
  int i=1;                     Hello 2
  do                           Hello 3
  {                            Hello 4
                               Hello 5
    printf("Hello %dn",i);    Hello 6
    i++;                       Hello 7
  }                            Hello 8
  while(i<=10);                Hello 9
 getch();                      Hello 10
 return 0;
}
                                           9
for
•
         for (init_stmt; condition; update_stmt)
         {
            statement1;
            statement2;
            :
            statementN;
         }



•
    1.             init_stmt

    2.      condition
     statement1...statementN
                                                   10
for
                                            START


                                           init_stmt

for (init_stmt; condition; update_stmt)
{
   statement1;
                                                        false
   statement2;                             condition
   :
   statementN;
}
                                           true
                                          Statement1


                                          StatementN


                                          update_stmt



                                             END
                                                                11
for
#include <stdio.h>
int main()                    for1.c
{                           Hello 1
                            Hello 2
  int i;                    Hello 3
  for(i=1;i<=10;i++)        Hello 4
  {                         Hello 5
                            Hello 6
    printf("Hello %d",i);   Hello 7
    printf("n");           Hello 8
  }                         Hello 9
                            Hello 10
 getch();
 return 0;
}                                      12

Contenu connexe

En vedette

ใบความรู้ เรื่อง การค้นหาเว็บ
ใบความรู้  เรื่อง การค้นหาเว็บใบความรู้  เรื่อง การค้นหาเว็บ
ใบความรู้ เรื่อง การค้นหาเว็บ
เทวัญ ภูพานทอง
 
ใบความรู้ เรื่อง การนำทางเบื้องต้น
ใบความรู้  เรื่อง การนำทางเบื้องต้นใบความรู้  เรื่อง การนำทางเบื้องต้น
ใบความรู้ เรื่อง การนำทางเบื้องต้น
เทวัญ ภูพานทอง
 
ใบความรู้ เรื่อง การจดทะเบียน Domain
ใบความรู้  เรื่อง การจดทะเบียน Domainใบความรู้  เรื่อง การจดทะเบียน Domain
ใบความรู้ เรื่อง การจดทะเบียน Domain
เทวัญ ภูพานทอง
 
การประมวลผลข้อมูลและสารสนเทศ
การประมวลผลข้อมูลและสารสนเทศการประมวลผลข้อมูลและสารสนเทศ
การประมวลผลข้อมูลและสารสนเทศ
เทวัญ ภูพานทอง
 
ใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ต
ใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ตใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ต
ใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ต
เทวัญ ภูพานทอง
 
ใบความรู้ เรื่อง บริการในอินเทอร์เน็ต
ใบความรู้ เรื่อง บริการในอินเทอร์เน็ตใบความรู้ เรื่อง บริการในอินเทอร์เน็ต
ใบความรู้ เรื่อง บริการในอินเทอร์เน็ต
เทวัญ ภูพานทอง
 
ใบความรู้ เรื่อง ประโยชน์การสืบค้น
ใบความรู้  เรื่อง ประโยชน์การสืบค้นใบความรู้  เรื่อง ประโยชน์การสืบค้น
ใบความรู้ เรื่อง ประโยชน์การสืบค้น
เทวัญ ภูพานทอง
 
การปรับแต่งหน้าจอคอมพิวเตอร์
การปรับแต่งหน้าจอคอมพิวเตอร์การปรับแต่งหน้าจอคอมพิวเตอร์
การปรับแต่งหน้าจอคอมพิวเตอร์
เทวัญ ภูพานทอง
 
ใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ต
ใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ตใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ต
ใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ต
เทวัญ ภูพานทอง
 

En vedette (20)

ใบความรู้ เรื่อง การค้นหาเว็บ
ใบความรู้  เรื่อง การค้นหาเว็บใบความรู้  เรื่อง การค้นหาเว็บ
ใบความรู้ เรื่อง การค้นหาเว็บ
 
ใบความรู้ที่ 1 เรื่อง คุณสมบัติของคอมพิวเตอร์
ใบความรู้ที่ 1 เรื่อง คุณสมบัติของคอมพิวเตอร์ใบความรู้ที่ 1 เรื่อง คุณสมบัติของคอมพิวเตอร์
ใบความรู้ที่ 1 เรื่อง คุณสมบัติของคอมพิวเตอร์
 
ใบความรู้ เรื่อง การนำทางเบื้องต้น
ใบความรู้  เรื่อง การนำทางเบื้องต้นใบความรู้  เรื่อง การนำทางเบื้องต้น
ใบความรู้ เรื่อง การนำทางเบื้องต้น
 
ใบความรู้ เรื่อง การจดทะเบียน Domain
ใบความรู้  เรื่อง การจดทะเบียน Domainใบความรู้  เรื่อง การจดทะเบียน Domain
ใบความรู้ เรื่อง การจดทะเบียน Domain
 
การประมวลผลข้อมูลและสารสนเทศ
การประมวลผลข้อมูลและสารสนเทศการประมวลผลข้อมูลและสารสนเทศ
การประมวลผลข้อมูลและสารสนเทศ
 
ใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ต
ใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ตใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ต
ใบความรู้ เรื่อง ภาษาสื่อสารในอินเทอร์เน็ต
 
การเพิ่มบล็อกผู้บริหารใน Obeclms
การเพิ่มบล็อกผู้บริหารใน Obeclmsการเพิ่มบล็อกผู้บริหารใน Obeclms
การเพิ่มบล็อกผู้บริหารใน Obeclms
 
ใบความรู้ เรื่อง บริการในอินเทอร์เน็ต
ใบความรู้ เรื่อง บริการในอินเทอร์เน็ตใบความรู้ เรื่อง บริการในอินเทอร์เน็ต
ใบความรู้ เรื่อง บริการในอินเทอร์เน็ต
 
เริ่มต้นกับภาษาซี
เริ่มต้นกับภาษาซีเริ่มต้นกับภาษาซี
เริ่มต้นกับภาษาซี
 
ประกาศรับสมัครนักเรียนโรงเรียนนามนพิทยาคม
ประกาศรับสมัครนักเรียนโรงเรียนนามนพิทยาคมประกาศรับสมัครนักเรียนโรงเรียนนามนพิทยาคม
ประกาศรับสมัครนักเรียนโรงเรียนนามนพิทยาคม
 
โครงสร้างโปรแกรมภาษาซี
โครงสร้างโปรแกรมภาษาซีโครงสร้างโปรแกรมภาษาซี
โครงสร้างโปรแกรมภาษาซี
 
ใบความรู้ เรื่อง ประโยชน์การสืบค้น
ใบความรู้  เรื่อง ประโยชน์การสืบค้นใบความรู้  เรื่อง ประโยชน์การสืบค้น
ใบความรู้ เรื่อง ประโยชน์การสืบค้น
 
การปรับแต่งหน้าจอคอมพิวเตอร์
การปรับแต่งหน้าจอคอมพิวเตอร์การปรับแต่งหน้าจอคอมพิวเตอร์
การปรับแต่งหน้าจอคอมพิวเตอร์
 
ใบความรู้ที่ 3 เรื่อง กำเนิดกูเกิล
ใบความรู้ที่ 3 เรื่อง  กำเนิดกูเกิลใบความรู้ที่ 3 เรื่อง  กำเนิดกูเกิล
ใบความรู้ที่ 3 เรื่อง กำเนิดกูเกิล
 
การสร้างไอคอนทรงกลม
การสร้างไอคอนทรงกลมการสร้างไอคอนทรงกลม
การสร้างไอคอนทรงกลม
 
โปรแกรมตกแต่งภาพ
โปรแกรมตกแต่งภาพโปรแกรมตกแต่งภาพ
โปรแกรมตกแต่งภาพ
 
Job1
Job1Job1
Job1
 
ใบความรู้หน่วยที่ 1
ใบความรู้หน่วยที่ 1ใบความรู้หน่วยที่ 1
ใบความรู้หน่วยที่ 1
 
ใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ต
ใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ตใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ต
ใบความรู้ เรื่อง ผู้ดูแลอินเทอร์เน็ต
 
การเปรียบเทียบเงื่อนไข
การเปรียบเทียบเงื่อนไขการเปรียบเทียบเงื่อนไข
การเปรียบเทียบเงื่อนไข
 

Plus de เทวัญ ภูพานทอง

Plus de เทวัญ ภูพานทอง (20)

คู่มือการใช้งาน Kahoot
คู่มือการใช้งาน Kahootคู่มือการใช้งาน Kahoot
คู่มือการใช้งาน Kahoot
 
คู่มือการใช้งาน Kahoot
คู่มือการใช้งาน Kahootคู่มือการใช้งาน Kahoot
คู่มือการใช้งาน Kahoot
 
คู่มือการใช้งาน Plicker
คู่มือการใช้งาน Plickerคู่มือการใช้งาน Plicker
คู่มือการใช้งาน Plicker
 
การสืบค้นข้อมูลชั้นสูง
การสืบค้นข้อมูลชั้นสูงการสืบค้นข้อมูลชั้นสูง
การสืบค้นข้อมูลชั้นสูง
 
การสืบค้นข้อมูลประเภทรูปภาพ
การสืบค้นข้อมูลประเภทรูปภาพการสืบค้นข้อมูลประเภทรูปภาพ
การสืบค้นข้อมูลประเภทรูปภาพ
 
การสืบค้นข้อมูลประเภทข้อความ
การสืบค้นข้อมูลประเภทข้อความการสืบค้นข้อมูลประเภทข้อความ
การสืบค้นข้อมูลประเภทข้อความ
 
กลยุทธ์การสืบค้นข้อมูล
กลยุทธ์การสืบค้นข้อมูลกลยุทธ์การสืบค้นข้อมูล
กลยุทธ์การสืบค้นข้อมูล
 
เครื่องมือค้นหา (Search engine)
เครื่องมือค้นหา (Search engine)เครื่องมือค้นหา (Search engine)
เครื่องมือค้นหา (Search engine)
 
ประเภทของ Search engine
ประเภทของ Search engineประเภทของ Search engine
ประเภทของ Search engine
 
เครื่องมือในการค้นหา
เครื่องมือในการค้นหาเครื่องมือในการค้นหา
เครื่องมือในการค้นหา
 
ประโยชน์ของการสืบค้น
ประโยชน์ของการสืบค้นประโยชน์ของการสืบค้น
ประโยชน์ของการสืบค้น
 
การค้นหาเว็บด้วย Internet Expolorer
การค้นหาเว็บด้วย Internet Expolorerการค้นหาเว็บด้วย Internet Expolorer
การค้นหาเว็บด้วย Internet Expolorer
 
เอกสารประกอบการพิจารณาครูดีในดวงใจ ปี 2559
เอกสารประกอบการพิจารณาครูดีในดวงใจ  ปี 2559เอกสารประกอบการพิจารณาครูดีในดวงใจ  ปี 2559
เอกสารประกอบการพิจารณาครูดีในดวงใจ ปี 2559
 
เอกสารประกอบการพิจารณา Obec Awards ปีการศึกษา 2558
เอกสารประกอบการพิจารณา Obec Awards ปีการศึกษา 2558เอกสารประกอบการพิจารณา Obec Awards ปีการศึกษา 2558
เอกสารประกอบการพิจารณา Obec Awards ปีการศึกษา 2558
 
ประกาศผล การประกวดสื่อของ สพฐ.ปีการศึกษา2557
ประกาศผล การประกวดสื่อของ สพฐ.ปีการศึกษา2557ประกาศผล การประกวดสื่อของ สพฐ.ปีการศึกษา2557
ประกาศผล การประกวดสื่อของ สพฐ.ปีการศึกษา2557
 
ใบความรู้ เรื่อง รูปแบบรายงานโครงงาน
ใบความรู้ เรื่อง รูปแบบรายงานโครงงานใบความรู้ เรื่อง รูปแบบรายงานโครงงาน
ใบความรู้ เรื่อง รูปแบบรายงานโครงงาน
 
รายงานเยี่ยมบ้านนักเรียน ปีการศึกษา 2557
รายงานเยี่ยมบ้านนักเรียน ปีการศึกษา 2557รายงานเยี่ยมบ้านนักเรียน ปีการศึกษา 2557
รายงานเยี่ยมบ้านนักเรียน ปีการศึกษา 2557
 
เอกสารเสนอ Best practice ครูเต้
เอกสารเสนอ Best practice ครูเต้เอกสารเสนอ Best practice ครูเต้
เอกสารเสนอ Best practice ครูเต้
 
แบบเสนอขอรับรางวัล หนึ่งแสนครูดี
แบบเสนอขอรับรางวัล หนึ่งแสนครูดีแบบเสนอขอรับรางวัล หนึ่งแสนครูดี
แบบเสนอขอรับรางวัล หนึ่งแสนครูดี
 
รายงานผลการปฏิบัติงานและการประเมินตนเอง ปี 2556
รายงานผลการปฏิบัติงานและการประเมินตนเอง ปี 2556รายงานผลการปฏิบัติงานและการประเมินตนเอง ปี 2556
รายงานผลการปฏิบัติงานและการประเมินตนเอง ปี 2556
 

Dernier

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Dernier (20)

Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

คำสั่งวนซ้ำ

  • 1. ..
  • 3. i++ = i = i--1 = i+ i = i- 1 i+=5 = i= i+i-=5 = 5 i = i- 5 3
  • 4. while while (condition) START { stmt1; stmt2; : false condition stmtN; } true Statement • stmt1 stmtN Statement condition END 4
  • 5. Counting Loop) • • int i, sum = 0; i = 1; while (i <= 10) { sum = sum + i; i = i + 1; } printf("Sum = %dn", sum); 5
  • 6. while #include <stdio.h> int main() while1.c { Hello 1 Hello 2 int i=1; Hello 3 while(i<=10) Hello 4 { Hello 5 Hello 6 printf("Hello %dn",i); Hello 7 i++; Hello 8 } Hello 9 Hello 10 getch(); return 0; } 6
  • 7. while (INFINITY LOOP) #include <stdio.h> int main() while2.c { Hello 1 int i=1; Hello 2 while(1) Hello 3 { Hello 4 printf("Hello %dn",i); Hello 5 if(i==10) Hello 6 Hello 7 break; Hello 8 i++; Hello 9 } Hello 10 getch(); return 0; } 7
  • 8. do…while do START { stmt1; stmt2; : Statement1 stmtN; } while (condition); StatementN • stmt1...stmtN true condition condition false • END stmt1...stmtN 8
  • 9. do…while #include <stdio.h> int main() dowhile1.c { Hello 1 int i=1; Hello 2 do Hello 3 { Hello 4 Hello 5 printf("Hello %dn",i); Hello 6 i++; Hello 7 } Hello 8 while(i<=10); Hello 9 getch(); Hello 10 return 0; } 9
  • 10. for • for (init_stmt; condition; update_stmt) { statement1; statement2; : statementN; } • 1. init_stmt 2. condition statement1...statementN 10
  • 11. for START init_stmt for (init_stmt; condition; update_stmt) { statement1; false statement2; condition : statementN; } true Statement1 StatementN update_stmt END 11
  • 12. for #include <stdio.h> int main() for1.c { Hello 1 Hello 2 int i; Hello 3 for(i=1;i<=10;i++) Hello 4 { Hello 5 Hello 6 printf("Hello %d",i); Hello 7 printf("n"); Hello 8 } Hello 9 Hello 10 getch(); return 0; } 12