Nested Loops & Conditionals 🌟 – Grade 6 Coding
59 practice questions included
Free lessons: 1 of 5
🧠 Practice Questions 59 total
🧠
Practice Questions
10 of 59 questions
1
/
10
What is a nested loop?
Explanation:
Hello superstar! A nested loop is when one loop is placed inside another. This is very useful for grids and patterns. You are doing wonderfully!
To draw a 3x3 grid of stars, you can use:
Explanation:
Nested loops are perfect for 2D patterns like grids.
What does an IF statement do?
Explanation:
Conditionals (IF) allow the program to choose different actions.
REPEAT 3 TIMES: REPEAT 4 TIMES: print '*' . How many stars printed?
Explanation:
Outer loop 3 times, inner loop 4 times = 12 stars.
IF score > 50 THEN 'Pass' ELSE 'Try again'. This is an example of:
Explanation:
IF-THEN-ELSE makes decisions.
A nested loop is useful for:
Explanation:
Perfect for 2D repeating tasks.
In coding, ELSE is used with:
Explanation:
ELSE gives the alternative action when IF is false.
Outer loop runs 2 times, inner loop runs 5 times. Total executions of inner code?
Explanation:
2 × 5 = 10.
IF temperature > 30 THEN 'Wear shorts' is a:
Explanation:
It checks a condition and chooses action.
To print a triangle of stars with nested loops, the outer loop controls:
Explanation:
Outer usually controls rows.
🏆
🔒
10 of 59 questions shown
49 more questions are waiting for you. Unlock all Grade 1–6 lessons and questions with InukMath Premium.
🔓 Get Full Access