

Câu hỏi trắc nghiệm: Mảng một chiều
Presentation
•
Information Technology (IT)
•
Vocational training
•
Hard
Le Cham
Used 1+ times
FREE Resource
1 Slide • 10 Questions
1
Mảng một chiều
By Le Cham
2
Multiple Choice
Câu 1: Cú pháp nào sau đây là đúng khi khai báo mảng một chiều trong C?
int arr;
int arr(5);
int arr[5];
arr int[5];
3
Multiple Choice
Câu 2: Mảng int a[10]; có bao nhiêu phần tử?
9
10
11
Không xác định
4
Multiple Choice
Câu 3: Chỉ số (index) đầu tiên của mảng trong C là:
-1
1
0
Phụ thuộc vào compiler
5
Multiple Choice
Câu 4: Đoạn mã nào sau đây in ra tất cả phần tử của mảng a[5]?
for(i = 1; i <= 5; i++) printf("%d", a[i]);
for(i = 0; i < 5; i++) printf("%d", a[i]);
for(i = 0; i <= 5; i++) printf("%d", a[i]);
for(i = 1; i < 5; i++) printf("%d", a[i]);
6
Multiple Choice
Câu 5: Đâu là cách đúng để nhập các phần tử của mảng float a[10];?
scanf("%f", a);
scanf("%f", &a);
for(i = 0; i < 10; i++) scanf("%f", &a[i]);
for(i = 0; i < 10; i++) scanf("%f", a[i]);
7
Multiple Choice
Câu 6: Đâu là khai báo mảng a gồm n phần tử nhập từ bàn phím?
int n; scanf("%d", &n); int a[n];
int n; int a[n]; scanf("%d", &n);
int a[n]; scanf("%d", &n);
int a[]; scanf("%d", &n);
8
Multiple Choice
Câu 7: Mảng int a[5] = {1, 2}; sẽ có giá trị gì?
a[0]=1, a[1]=2, a[2]=?, a[3]=?, a[4]=?
a[0]=1, a[1]=2, a[2]=0, a[3]=0, a[4]=0
a[0]=0, a[1]=0, a[2]=1, a[3]=2, a[4]=0
Lỗi biên dịch
9
Multiple Choice
Câu 8: Muốn tính tổng các phần tử trong mảng a[100], câu lệnh phù hợp là:
for(i=0;i<100;i++) tong += a[i];
for(i=1;i<=100;i++) tong += a[i];
for(i=0;i<100;i++) tong = a[i];
for(i=0;i<=100;i++) tong += a[i];
10
Multiple Choice
Câu 9: Khi truy cập a[1000] trong mảng int a[10]; thì điều gì xảy ra?
In ra giá trị rác
Gây lỗi runtime (tràn bộ nhớ)
Không có gì xảy ra
Cả A và B
11
Multiple Choice
Câu 10: Đâu là cách đúng để in ra phần tử lớn nhất trong mảng a[n]?
max = a[1]; for(i=0;i<n;i++) if(a[i]>max) max=a[i];
max = a[0]; for(i=1;i<n;i++) if(a[i]>max) max=a[i];
for(i=0;i<n;i++) if(a[i]>max) max=a[i];
max = a[n]; for(i=0;i<n;i++) if(a[i]>max) max=a[i];
Mảng một chiều
By Le Cham
Show answer
Auto Play
Slide 1 / 11
SLIDE
Similar Resources on Wayground
8 questions
Graduation Questions PRE and Level 1
Presentation
•
KG
8 questions
Naturaleza y origen de la justicia en La república de Platón
Presentation
•
KG
11 questions
Variety
Presentation
•
KG
7 questions
W7 Quiz 2024
Presentation
•
Professional Development
9 questions
Enseñanza en aulas diversas
Presentation
•
Professional Development
10 questions
Protocolo de Actuación AE, MI y ASI
Presentation
•
Professional Development
12 questions
Prepositions
Presentation
•
3rd Grade
12 questions
Way Maker
Presentation
•
KG
Popular Resources on Wayground
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
10 questions
Identify Fractions, Mixed Numbers & Improper Fractions
Quiz
•
3rd - 4th Grade