FBISE, NCP & NBF-aligned resources for Classes 9–12

/9

Computer Chapter 3 : Topic 4.5

Construct and populate arrays using loops

1 / 9

A student is instructed to create an empty array in JavaScript and then fill it dynamically using a loop based on user-defined size. Which approach correctly initializes the array before population?

2 / 9

A JavaScript program uses a loop to assign values to an array where each element stores its index multiplied by 2. Which statement best describes this process?

3 / 9

In a program, a student uses a for loop to fill an array of size 5 with values entered by the user. Why is a loop preferred over writing individual assignments?

4 / 9

Which JavaScript loop structure is most appropriate when constructing an array by assigning values to each index from 0 to n-1?

5 / 9

A program initializes an empty array and then uses arr[i] = i + 1 inside a loop. What is the main effect of this statement?

6 / 9

A student writes a loop that runs from i = 0 to i < 10 and stores i * i into an array. What type of data is being stored in the array?

7 / 9

While constructing an array using a loop, a programmer mistakenly starts the loop from i = 1 instead of i = 0. What is the most likely outcome?

8 / 9

A JavaScript program uses a loop to populate an array and later prints all elements using another loop. Which concept is primarily demonstrated here?

9 / 9

A teacher asks students to store numbers 1 to 100 in an array using a loop instead of manual entry. What is the key advantage of this method?

Your score is

0%

9th class objective books