
If Statements review
Authored by Lioubov Rogalskaia
Other
12th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
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
10 questions
Housekeeping Positions
Quiz
•
9th - 12th Grade
10 questions
Famous quotes - Reported Speech
Quiz
•
10th Grade - University
10 questions
Znajomość Marvel'a
Quiz
•
KG - Professional Dev...
10 questions
Student Leadership
Quiz
•
9th - 12th Grade
9 questions
Law of Cosine
Quiz
•
12th Grade
10 questions
Understanding Plagiarism
Quiz
•
6th Grade - University
10 questions
Lesson 5A Literature review: Criteria in Selecting Literature
Quiz
•
12th Grade
10 questions
10.1 Utility Expenses
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Other
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
15 questions
Making Inferences
Quiz
•
7th - 12th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
15 questions
Atomic Habits: Career Habits
Lesson
•
9th - 12th Grade
20 questions
Banking
Quiz
•
9th - 12th Grade
15 questions
Exponential Growth and Decay Word Problems Practice
Quiz
•
9th - 12th Grade
18 questions
AP Bio Insta-Review Topic 6.1*: DNA & RNA Structure
Quiz
•
9th - 12th Grade