FBISE, NCP & NBF-aligned resources for Classes 9–12
Browse by Class
Browse by Type
Computer Chapter 3 : Topic 4.3
Sequence, Selection and Repetition in JavaScript
1 / 15
Which programming concept ensures that JavaScript code runs step-by-step in a fixed order without skipping any instruction?
Reasoning: Sequence executes instructions in a strict linear order.
2 / 15
Which structure in JavaScript is mainly used when decisions must be made based on a condition?
Reasoning: Selection allows decision-making using conditions like if/else.
3 / 15
Which structure is responsible for executing a block of code multiple times in JavaScript?
Reasoning: Repetition (loops) repeats code based on a condition or count.
4 / 15
What is the correct order of basic algorithm structures used in programming logic?
Reasoning: Most algorithms are built using sequence, selection, and repetition.
5 / 15
Which JavaScript statement is an example of selection structure?
Reasoning: if is used to make decisions based on conditions.
6 / 15
Which JavaScript loop is best used when the number of repetitions is unknown?
Reasoning: while loop continues until a condition becomes false.
7 / 15
What is the main purpose of a for loop in JavaScript algorithms?
Reasoning: for loop is used when repetition count is known.
8 / 15
Which statement best describes how selection differs from sequence?
Reasoning: Sequence is linear; selection depends on conditions.
9 / 15
What happens if a repetition condition in a loop never becomes false?
Reasoning: If condition never becomes false, loop runs endlessly.
10 / 15
Which of the following is NOT part of basic programming control structures?
Reasoning: Encryption is not a control structure; it is a security technique.
11 / 15
In JavaScript, what is the role of an else statement in selection?
Reasoning: else handles the false condition path.
12 / 15
Which loop ensures that code executes at least once before checking condition?
Reasoning: do...while runs first, then checks condition.
13 / 15
What is the main advantage of using repetition in JavaScript algorithms?
Reasoning: Loops reduce redundancy by repeating code automatically.
14 / 15
Which of the following best represents sequence in a real-life example?
Reasoning: Sequence follows fixed step-by-step actions.
15 / 15
What is the result of incorrect use of selection in a JavaScript program?
Reasoning: Wrong conditions lead to incorrect decision-making results.
Your score is
Restart quiz