computer MCQs
10th • Chapter 04
50 Questions TextBook
1
A data structure is a container used to store a collection of data items in a ___.
2
An array is a data structure that can hold multiple values of the ___ data type.
3
An important property of an array is that it stores all values at ___ locations in computer memory.
4
In the C array declaration 'int marks[20];', what does 'int' represent?
5
What is the unique identifier used to refer to an array called?
6
The maximum number of elements an array can hold is defined by its ___.
7
Assigning values to an array for the first time is called ___.
8
The index of the first element in any C array is always ___?
9
If an array is declared as 'float data[50];', what is the index of the last element?
10
To access a specific element in an array, you use the array name followed by the ___ in square brackets.
11
What structure is used to repeat a set of statements multiple times in C?
12
Which of the following is NOT a loop structure mentioned in the chapter?
13
The general syntax of a for loop is 'for(initialization; condition; ___ )'.
14
Which part of the 'for' loop is executed only once, at the very beginning?
15
If the condition in a 'for' loop is initially false, the loop body will be executed ___ times.
16
A loop inside another loop is called a ___ loop.
17
What is each single run or execution of a loop's body called?
18
In the code 'for(int i = 0; i < 10; i++)', the loop will run for how many iterations?
19
To initialize all elements of an array in a single statement, it must be done at the time of ___?
20
What will happen if you try to initialize a whole array with '{}' after it has been declared?
B
It initializes only the first elementC
The compiler generates an errorD
It fills the array with zeros 21
In C, 'scanf' is a predefined function used for ___?
B
mathematical calculationC
taking input from the user 22
Variables can be used as array ___ to access elements dynamically.
23
What data type would be most appropriate for an array storing the heights of students, like 5.7, 6.2?
24
The 'Code to repeat' inside a loop's curly braces is known as the ___ of the loop.
25
After the body of a 'for' loop executes, which part is typically executed next?
26
Nested loops are particularly useful for repeating a ___ multiple times.
27
To read or write values in an entire array efficiently, you should use a ___?
A
single printf statement 28
What is the result of 'fact = fact * i;' inside a loop designed to calculate a factorial?
C
It multiplies to get the factorialD
It subtracts the numbers 29
If an array is declared as 'char vowels[5]', how many character values can it store?
30
In Programming Time 4.9, the 'flag' variable is used to determine if a number is ___?
31
In the statement 'printf("%d", marks[i]);', 'i' is a ___ used as an index.
32
An 'int' array can hold multiple ___ values.
33
What is the purpose of the statement 'i++' in a for loop?
A
To decrease the counterB
To initialize the counterD
To increase the counter 34
According to the flowchart, if the loop condition is true, what happens next?
C
Execute Associated Code 35
Which of the following correctly declares and initializes an array of 3 integers?
36
The expression 'i % n == 0' checks if 'i' is ___ by 'n'.
37
A loop that never terminates is called an ___ loop.
38
To print numbers from 1 to 10, the loop condition could be ___?
39
Which part of the 'for' loop is checked before every iteration?
40
In a nested loop structure, the ___ loop completes all its iterations for every single iteration of the ___ loop.
41
The statement 'for(int i = 1; i <= 5; i++)' will cause the loop to iterate how many times?
42
Which keyword is associated with the 'for' loop structure?
43
The structure that allows repetition of a set of instructions is known as a ___ structure.
44
Contiguous memory allocation means the memory blocks are ___ one another.
45
What is the output of 'printf("%d", array[2]);' if 'array' is '{10, 20, 30, 40}'?
46
What is the primary focus of Chapter 4: Data and Repetition?
D
Object-Oriented Programming 47
A 'for' loop combines initialization, condition, and increment/decrement in a ___ line.
48
The 'break' statement is used to ___ a loop.
49
The unique identifier for an array is its ___?
50
Using loops makes it easier to ___ and ___ values in arrays.