
array c++

Quiz
•
Computers
•
University
•
Easy
Nafi Fajri
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Pilih sintaks yang benar untuk mendeklarasikan array bilangan bulat dengan 5 elemen.
int arr[5];
int arr = [5];
array<int> arr[5];
int arr(5);
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Diberikan array berikut:
int angka[] = {10, 20, 30, 40, 50};
Berapa elemen yang dimiliki oleh array tersebut?
2
3
4
5
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Diberikan array berikut:
int data[] = {7, 14, 21, 28, 35};
Apa output dari perintah cout << data[3];?
7
14
21
28
35
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang terjadi jika Anda mencoba mengakses elemen di luar batas array?
Program akan berhenti
Output akan berupa nilai default (0).
Tidak dapat dipastikan, mungkin terjadi kesalahan memori.
Compiler akan memberikan error.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Manakah loop yang benar untuk mencetak semua elemen array int arr[5] = {1, 2, 3, 4, 5};?
for(int i = 1; i <= 5; i++)
cout << arr[i];
for(int i = 0; i <= 5; i++)
cout << arr[i];
for(int i = 0; i < 5; i++)
cout << arr[i];
for(int i = 1; i < 5; i++)
cout << arr[i];
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Diberikan array berikut:
int arr[] = {2, 4, 6, 8, 10};
sizeof(arr)
sizeof(arr)/sizeof(int)
sizeof(arr)/sizeof(arr[0])
Kedua B dan C benar.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa kegunaan array dalam C++?
Menyimpan satu nilai saja.
Menyimpan banyak nilai dengan tipe data berbeda.
Menyimpan banyak nilai dengan tipe data yang sama.
Menyimpan data dalam format string.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
ARRAYLIST - JAVA

Quiz
•
University
15 questions
C programming

Quiz
•
University
15 questions
Preliminary Round

Quiz
•
University
15 questions
Milking Minds 2 17-01-24

Quiz
•
University
15 questions
Java Programming

Quiz
•
University
10 questions
RVS_Tech_quizz_even2024-25

Quiz
•
University
10 questions
Rapid Round 2

Quiz
•
University
6 questions
Array 2: Unit 8

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University