
quiz 3 progdas
Authored by Richard Harryson
Computers
University
Used 9+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Apa perbedaan antara for loop dan while loop?
for loop hanya digunakan untuk array, sedangkan while loop digunakan untuk struktur data lainnya.
for loop lebih cocok untuk perulangan dengan jumlah iterasi yang diketahui, sementara while loop lebih fleksibel untuk kondisi dinamis.
for loop memiliki waktu eksekusi yang lebih cepat daripada while loop
while loop hanya dapat digunakan dengan pernyataan if
2.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Apa tujuan dari pernyataan break dalam sebuah loop?
Untuk melewati iterasi saat ini dan melanjutkan ke iterasi berikutnya.
Untuk keluar dari loop secara langsung, terlepas dari kondisi loop.
Untuk memulai ulang loop dari awal.
Untuk menggabungkan beberapa loop menjadi satu.
3.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Apa yang terjadi jika kondisi di dalam loop tidak pernah menjadi false?
Program akan terus menjalankan loop tanpa henti, yang dikenal sebagai infinite loop.
Program akan berhenti secara otomatis setelah beberapa iterasi.
Program akan menghasilkan nilai acak setiap kali dijalankan.
Kompiler akan memberikan peringatan kesalahan sebelum menjalankan program.
4.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Apa output dari kode ini?
for (int i = 0; i < 5; i++) {
if (i == 3) break;
cout << i << " ";
}
0 1 2 3
0 1 2
1 2 3
1 2
5.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Berapa kali loop akan dijalankan?
for (int i = 0; i < 10; i++) {
if (i % 3 == 0) continue;
cout << i << " ";
}
10
7
6
3
6.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Apa efek dari menggunakan continue dalam sebuah loop?
Menghentikan loop secara langsung.
Menyebabkan loop dimulai ulang dari awal.
Melewati iterasi saat ini dan melanjutkan ke iterasi berikutnya.
Melewati kode fungsi program kontrol yang sedang berjalan.
7.
MULTIPLE CHOICE QUESTION
45 sec • 5 pts
Apa perbedaan utama antara while loop dan do-while loop?
do-while loop menjalankan perulangan setidaknya satu kali sebelum memeriksa kondisi, sedangkan while loop langsung memeriksa kondisi.
while loop hanya bisa digunakan dengan array, sedangkan do-while loop hanya untuk fungsi.
do-while loop hanya digunakan untuk perulangan bersyarat, sedangkan while loop tidak.
while loop menjalankan perulangan dua kali lebih cepat dibandingkan do-while loop.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
16 questions
Python
Quiz
•
University
20 questions
PHP First Internal Practical Viva
Quiz
•
University
20 questions
Hash
Quiz
•
University
19 questions
Quiz sobre Estructuras Selectivas en Java
Quiz
•
12th Grade - University
15 questions
Coding club Summit Online Quiz
Quiz
•
University
20 questions
Infrastructure (Network)
Quiz
•
University
20 questions
C Quest 2.0
Quiz
•
University
20 questions
CSE493_QUIZ 1
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
20 questions
Endocrine System
Quiz
•
University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
30 questions
W25: PSYCH 250 - Exam 2 Practice
Quiz
•
University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
38 questions
Unit 8 Review - Absolutism & Revolution
Quiz
•
10th Grade - University