
หน่วยที่ 4 การเขียนโปรแกรมแบบเลือกทำ

Quiz
•
Professional Development
•
Professional Development
•
Medium
นางสาวพุทธิพร สุทธิปัญญา
Used 17+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
ข้อใดเป็นผลรันของโปรแกรมต่อไปนี้
#include<stdio.h>
void main()
{
int age=35;
if (age<=60)
printf(“You are young\n”);
}
age<=60
You are young
age=35
ถูกทุกข้อ
2.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
ข้อใดเป็นผลรันของโปรแกรมต่อไปนี้
#include<stdio.h>
void main()
{
int age=65;
if (age<=60)
printf(“You are young\n”);
else
printf(“You are old\n”);
}
age<=60
You are young
age=65
You are old
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
เครื่องหมายมากกว่าหรือเท่ากับ ในทางโปรแกรมจะต้องใช้สัญลักษณ์ใด
>=
<=
>>=
<<=
4.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
ข้อใดเป็นผลรันของโปรแกรมต่อไปนี้ ถ้าใส่ข้อมูลเข้าไปเป็น 5
#include <stdio.h>
main()
{
int a;
printf("Please enter number : ");
scanf("%d", &a);
switch (a){
case '9': printf("9 ");
case '8': printf(" 8 ");
case '7': printf(" 7 ");
case '6': printf(" 6 ");
case '5': printf(" 5 ");
case '4': printf(" 4 ");
case '3': printf(" 3 ");
case '2': printf(" 2 ");
case '1': printf(" 1 ");
default: printf("0");
}
}
5
12345
5 4 3 2 1 0
54321
5.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
#include <stdio.h>
int main()
{
int score;
printf("Enter your score: ");
scanf("%d", &score);
if (score >= 80) {
printf("You got an A.\n");
} else {
printf("You didn't get an A.\n");
}
return 0;
}
จากการเขียนโปรแกรมดังกล่าว ควรจะตั้งชื่อการทำงานของโปรแกรมว่าอย่างไร
โปรแกรมตรวจสอบคะแนนเกรด A
โปรแกรมตรวจสอบอากาศหนาวเย็น
โปรแกรมตรวจสอบจำนวนบวก ลบ หรือศูนย์
โปรแกรมตรวจสอบค่าจำนวนเต็มสองค่า
6.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
#include <stdio.h>
int main()
{
int score;
printf("Enter your score: ");
scanf("%d", &score);
if (score >= 50) {
printf("You passed.\n");
} else {
printf("You failed.\n");
}
return 0;
}
จากการเขียนโปรแกรมดังกล่าว ควรจะตั้งชื่อการทำงานของโปรแกรมว่าอย่างไร
โปรแกรมตรวจสอบคะแนนผ่านหรือไม่
โปรแกรมตรวจสอบอากาศหนาวเย็น
โปรแกรมตรวจสอบจำนวนบวก ลบ หรือศูนย์
โปรแกรมตรวจสอบอายุการลงคะแนนเลือกตั้ง
7.
MULTIPLE CHOICE QUESTION
1 min • 2 pts
เขียนโปรแกรมที่รับตัวอักษรจากผู้ใช้ และตรวจสอบว่าตัวอักษรนั้นเป็นสระหรือไม่ (a, e, i, o, u)
#include <stdio.h>
int main() {
char c;
printf("Enter a character: ");
scanf(" %c", &c);
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') {
printf("%c is a vowel.\n", c);
} else {
printf("%c is not a vowel.\n", c);
}
return 0;
}
#include <stdio.h>
int main() {
int num;
printf("Enter an integer: ");
scanf("%d", &num);
if (num % 3 == 0) {
printf("%d is divisible by 3.\n", num);
} else {
printf("%d is not divisible by 3.\n", num);
}
return 0;
}
#include <stdio.h>
int main() {
int num;
printf("Enter an integer: ");
scanf("%d", &num);
if (num >= 1 && num <= 10) {
printf("%d is between 1 and 10.\n", num);
} else {
printf("%d is not between 1 and 10.\n");
}
return 0;
}
#include <stdio.h>
int main() {
int score;
printf("Enter your score: ");
scanf("%d", &score);
if (score >= 80) {
printf("You got an A.\n");
} else {
printf("You didn't get an A.\n");
}
return 0;
}
Create a free account and access millions of resources
Similar Resources on Wayground
5 questions
quizz04 - programacion 2 - C

Quiz
•
Professional Development
8 questions
REPASO C++

Quiz
•
Professional Development
15 questions
C Operators

Quiz
•
University - Professi...
10 questions
Web Development Workshop

Quiz
•
University - Professi...
10 questions
Programação C

Quiz
•
Professional Development
10 questions
PU - Day 1 assessments - Mahendran's batch

Quiz
•
Professional Development
15 questions
C Programming Tutorial 2 (Chapter 2)

Quiz
•
Professional Development
15 questions
Tutorial 1 Chapter 4 C Programming

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade
Discover more resources for Professional Development
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
5 questions
Setting goals for the year

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
20 questions
Employability Skills

Quiz
•
Professional Development