1 / 20

โปรแกรมทดสอบที่ 1 ทดสอบการแสดงผลข้อความ

โปรแกรมทดสอบที่ 1 ทดสอบการแสดงผลข้อความ. void main() { printf(“Hello world!<br>”); }. โปรแกรมทดสอบที่ 2 ทดสอบการแสดงผลข้อความพร้อมเลขจำนวนเต็ม. void main() { printf(“Sum %d +%d<br>”,5,120); }. โปรแกรมทดสอบที่ 3 ทดสอบการแสดงผลข้อความพร้อมเลขจำนวนจริง. void main() { float x=45.36;

flint
Télécharger la présentation

โปรแกรมทดสอบที่ 1 ทดสอบการแสดงผลข้อความ

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. โปรแกรมทดสอบที่1ทดสอบการแสดงผลข้อความโปรแกรมทดสอบที่1ทดสอบการแสดงผลข้อความ void main() { printf(“Hello world!\n”); }

  2. โปรแกรมทดสอบที่2ทดสอบการแสดงผลข้อความพร้อมเลขจำนวนเต็มโปรแกรมทดสอบที่2ทดสอบการแสดงผลข้อความพร้อมเลขจำนวนเต็ม void main() { printf(“Sum %d +%d\n”,5,120); }

  3. โปรแกรมทดสอบที่3ทดสอบการแสดงผลข้อความพร้อมเลขจำนวนจริงโปรแกรมทดสอบที่3ทดสอบการแสดงผลข้อความพร้อมเลขจำนวนจริง void main() { float x=45.36; printf("Real%f-%f\n",12.6,x); }

  4. โปรแกรมทดสอบที่4ทดสอบฟังก์ชั่นกำเนิดเสียงโปรแกรมทดสอบที่4ทดสอบฟังก์ชั่นกำเนิดเสียง void main() { beep(); }

  5. โปรแกรมทดสอบที่5ทดสอบฟังก์ชั่นกำเนิดเสียง tone void main() { tone(800.0,1.0); }

  6. โปรแกรมทดสอบที่6ทดสอบฟังก์ชั่นหน่วงเวลา sleep void main() { printf(“Count: 1\n”); sleep(2.0); printf(“Count: 2\n”); sleep(2.0); printf(“Count: 3\n”); }

  7. โปรแกรมทดสอบที่7ทดสอบฟังก์ชั่นตรวจจับการกดปุ่ม START void main() { start_press(); printf(“Count: 1\n”); sleep(2.0); printf(“Count: 2\n”); sleep(2.0); printf(“Count: 3\n”); }

  8. โปรแกรมทดสอบที่8ทดสอบฟังก์ชั่นควบคุมมอเตอร์โปรแกรมทดสอบที่8ทดสอบฟังก์ชั่นควบคุมมอเตอร์ void main() { motor(0,50); }

  9. โปรแกรมทดสอบที่9ทดสอบฟังก์ชั่นควบคุมมอเตอร์โปรแกรมทดสอบที่9ทดสอบฟังก์ชั่นควบคุมมอเตอร์ void main() { motor(0,50); motor(1,50); }

  10. โปรแกรมทดสอบที่10ทดสอบฟังก์ชั่นควบคุมมอเตอร์โปรแกรมทดสอบที่10ทดสอบฟังก์ชั่นควบคุมมอเตอร์ void main() { printf(“Start Press!”); start_press(); motor(0,50); motor(1,50); }

  11. โปรแกรมทดสอบที่11ทดสอบฟังก์ชั่นควบคุมมอเตอร์โปรแกรมทดสอบที่11ทดสอบฟังก์ชั่นควบคุมมอเตอร์ void main() { printf(“Start Press!”); start_press(); motor(0,50); motor(1,50); sleep(5.0); ao(); }

  12. โปรแกรมทดสอบที่12ทดสอบคำสั่งตรวจสอบเงื่อนไข if void main() { int x=5; if(x==5) { printf("Condition TURE!\n"); } }

  13. โปรแกรมทดสอบที่13ทดสอบคำสั่งตรวจสอบเงื่อนไข if void main() { int x = 200; float y = 23.8; if(x!=200) { beep(); } if(y>15.5) { y = y + 2.0; } printf("x=%d y=%f\n",x,y); }

  14. โปรแกรมทดสอบที่14 ทดสอบคำสั่งตรวจสอบเงื่อนไข if void main() { int x = 50; int y = 10; int result1,result2; if(x>40 && y>5) { result1 = 1; } if(x==50 && y>10) { result2 = 1; } printf("result1=%d result2=%d\n",result1,result2); }

  15. โปรแกรมทดสอบที่15ทดสอบคำสั่งตรวจสอบเงื่อนไข if void main() { int x = 12; int y = 6; int result1,result2; x++; if(x>=12 || y>5) { result1 = 1; } if(x==50 || y>10) { result2 = 1; } printf("result1=%d result2=%d\n",result1,result2); }

  16. โปรแกรมทดสอบที่16ทดสอบคำสั่งตรวจสอบเงื่อนไข if-else void main() { int value = 6; if(value==5) { printf("TRUE!\n"); beep(); } else { printf("FALSE!\n"); } }

  17. โปรแกรมทดสอบที่17ทดสอบคำสั่งตรวจสอบเงื่อนไข if-else void main() { int test = 3; if(test==1) { printf(" 1 TRUE!\n"); } else if(test==2) { printf(" 2 TRUE!\n"); } else if(test==3) { printf(" 3 TRUE!\n"); } else if(test==4) { printf(" 4 TRUE!\n"); } else { printf("FALSE!\n"); } }

  18. โปรแกรมทดสอบที่18ทดสอบคำสั่งตรวจสอบเงื่อนไข while void main() { int x=1; while(x<10) { x++; beep(); } printf("x=%d\n",x); }

  19. โปรแกรมทดสอบที่19 ทดสอบคำสั่งตรวจสอบเงื่อนไข while void main() { int x = 5; while(1) { beep(); sleep(1.0); } printf("x=%d\n",x); }

  20. โปรแกรมทดสอบที่20ทดสอบการทำซ้ำด้วยลูป while void main() { int i=0; while(1) { printf("Count: %d \n",i); sleep(1.0); i++; } }

More Related