
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
12 questions
Python Quiz 1.6

Quiz
•
University
10 questions
Java Arrays

Quiz
•
University
12 questions
Arrays C++

Quiz
•
University
12 questions
JavaScript Quiz

Quiz
•
University
10 questions
cp06-01-1D-Array

Quiz
•
University
10 questions
Ujian Tengah Semester Struktur Data

Quiz
•
University
10 questions
DSA(UNIT 1) Test 1

Quiz
•
University
10 questions
Basics of C

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University