Quiz-summary
0 of 10 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
Results
0 of 10 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score | |
Your score | |
Categories
- Not categorized 0%
-
ทำแบบทดสอบก่อนเรียนเสร็จเรียบร้อยแล้ว
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- Answered
- Review
- Question 1 of 10
1. Question
1 pointsคำสั่งใดใช้ตรวจสอบว่าถ้าตัวแปร x มากกว่า 0 จะแสดงข้อความ “Plus” แต่ถ้า x น้อยกว่า 0 จะแสดงข้อความ “Minus”
- Question 2 of 10
2. Question
1 pointsถ้า x=4 ,y=0, และ z=2; จงหาค่าของ x,y
และ z หลังทำคำสั่งต่อไปนี้
if ( x! = 0 )
y = 3;
else
z = 5;
- x = (4) y = (3) z = (2)
- Question 3 of 10
3. Question
1 pointsฟังก์ชั่น if-else ใช้กับเงื่อนไขแบบใด
- Question 4 of 10
4. Question
1 pointsข้อใดเป็นเงื่อนไขสำหรับใช้เป็นคำสั่งใน if ไม่ได้
- Question 5 of 10
5. Question
1 pointsจากส่วนของโปรแกรมต่อไปนี้
#include”stdio.h”
main() {
int x=3, y=5;
if(x<3)
y=x;
else if (y <= 5)
x=y+2;
printf(“%d %d”,x,y);
}
เมื่อโปรแกรมทำงานเสร็จแล้ว ค่าของ x และ y จะเป็นเท่าใด-
x = (7)
y = (5)
-
- Question 6 of 10
6. Question
1 pointsจากโปรแกรม ต้องกำหนดเงื่อนไขใดใน (…?…) โปรแกรมจะพิมพ์คำว่า “good bye”
int x=5, y=3 ;
if (…?…) {
printf(“positive\n”);
}
printf(“good bye”);
} - Question 7 of 10
7. Question
1 pointsคำสั่งใดต่อไปนี้ เป็นการตรวจสอบว่าตัวแปร x อยู่ในช่วงตั้งแต่ 20 ถึง 30
- Question 8 of 10
8. Question
1 pointsถ้าต้องการตรวจสอบว่า จำนวนเต็ม i ค่าใดเป็นเลขคู่ ให้พิมพ์ค่า i ทางหน้าจอ ต้องใช้เงื่อนไขใด
- #include
main(){
int i ;
if (i (%)2 == 0) ;
printf(“%d”,i);
}
- #include
- Question 9 of 10
9. Question
1 pointsจากส่วนของโปรแกรม กำหนดค่าเริ่มต้น x = 4, y = 0 และ z = 2 จงหาค่าของ x,y,z หลังทำคำสั่งต่อไปนี้
if (x && y)
x = 3;
else
y = 2;- x = (4)
y = (2)
z = (2)
- x = (4)
- Question 10 of 10
10. Question
1 pointsจงจับคู่คำสั่งควบคุมแบบทางเลือกให้ถูกต้อง
Sort elements
- เงื่อนไขแบบทางเลือกเดียว
- เงื่อนไขแบบสองทางเลือก
- เงื่อนไขแบบหลายทางเลือก
- if
- if else
- if ซ้อน