Week 4.2

Week 4.2

Professional Development

10 Qs

quiz-placeholder

Similar activities

Introduction to Excel

Introduction to Excel

KG - Professional Development

10 Qs

General sap

General sap

Professional Development

11 Qs

Closing Quiz (Peretas)

Closing Quiz (Peretas)

Professional Development

10 Qs

Java Strings and lops

Java Strings and lops

Professional Development

10 Qs

Cloud Computing Model Exam-IV PART-B

Cloud Computing Model Exam-IV PART-B

Professional Development

15 Qs

Computer Programming - Intro

Computer Programming - Intro

Professional Development

12 Qs

Microsoft 365 for Teachers

Microsoft 365 for Teachers

Professional Development

10 Qs

SEC+ Ch.8 Review Test

SEC+ Ch.8 Review Test

Professional Development

15 Qs

Week 4.2

Week 4.2

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

Poul Nichols

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax of a for loop in JavaScript?

for (initialization; condition; increment/decrement) { // Block of Code }

for { // Block of Code } (initialization; condition; increment/decrement)

for [initialization; condition; increment/decrement] { // Block of Code }

for (condition; initialization; increment/decrement) { // Block of Code }

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a for loop?

To execute a block of code repeatedly while a condition is true

To execute a block of code repeatedly until a condition is true

To execute a block of code once

To execute a block of code randomly

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between i++ and ++i in a for loop?

There is no difference

i++ increments i after the expression is evaluated, while ++i increments i before the expression is evaluated

i++ increments i by 2, while ++i increments i by 1

i++ decrements i, while ++i increments i

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

for (let i = 0; i < 5; i++) { console.log(i); }

0 1 2 3 4

1 2 3 4 5

0 1 2 3 4 5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about a nested for loop in JavaScript?

It is a loop inside another loop.

It can only iterate over arrays.

It can only iterate over objects.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

for (var i = 1; i <= 10; i++) {

if (i == 3) { document.write("*");}

}

*

*****

**********

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

for (var i = 3; i >= 1; i--) {

for (var j = 1; j <= i; j++) {document.write("*"); }

document.write("<br>"); }

*

***

***

***

*

**

***

***

**

*

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?