If Statements review

If Statements review

12th Grade

5 Qs

quiz-placeholder

Similar activities

Kriteria Reka Bentuk

Kriteria Reka Bentuk

7th - 12th Grade

10 Qs

Exoictic cars.

Exoictic cars.

5th Grade - Professional Development

10 Qs

D10-Trivia

D10-Trivia

12th Grade

10 Qs

Reconocer falacias

Reconocer falacias

12th Grade

10 Qs

NHSMUN 2024 Quiz

NHSMUN 2024 Quiz

9th - 12th Grade

10 Qs

Unit 1.4 Responding to medical instructions

Unit 1.4 Responding to medical instructions

12th Grade

10 Qs

Kuis Peluang (Tugas Diklat 7 Samisanov)

Kuis Peluang (Tugas Diklat 7 Samisanov)

12th Grade

10 Qs

EAP4B week 7.2AM The Amazon Rainforest

EAP4B week 7.2AM The Amazon Rainforest

12th Grade - University

10 Qs

If Statements review

If Statements review

Assessment

Quiz

Other

12th Grade

Hard

Created by

Lioubov Rogalskaia

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

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

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Of the following if statements, which one correctly executes three instructions if the

condition is true?

if (x < 0)

a = b * 2;

y = x;

z = a – y;

{

if (x < 0)

a = b * 2;

y = x;

z = a – y;

}

if { (x < 0)

a = b * 2;

y = x;

z = a – y ;

}

if (x < 0)

{

a = b * 2;

y = x;

z = a – y;

}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the sets of statements below will add 1 to x if x is positive and subtract 1 from x if x is negative but leave x alone if x is 0?

if (x > 0) x++;

else x--;

if (x > 0) x++;

else if (x < 0) x--;

if (x > 0) x++;

if (x < 0) x--;

else x = 0;

if (x == 0) x = 0;

else x++;

x--;

3.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

If x is currently 0, a = 5

and b = 5, what will x become after the statement is executed?


if (a > 0)

if (b < 0)

x = x + 5;

else

if (a > 5)

x = x + 4;

else

x = x + 3;

else

x = x + 2;

0

2

3

4

5

4.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

If x is currently 0, a = 0

and b = - 5, what will x become after the statement is executed?


if (a > 0)

if (b < 0)

x = x + 5;

else

if (a > 5)

x = x + 4;

else

x = x + 3;

else

x = x + 2;

0

2

3

4

5

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

If x is currently 0, a = 1

and b = -1, what will x become after the statement is executed?


if (a > 0)

if (b < 0)

x = x + 5;

else

if (a > 5)

x = x + 4;

else

x = x + 3;

else

x = x + 2;

0

2

3

4

5