WorksheetsComputer Science Concepts for Grade 10
Total questions: 12
Worksheet time: 6mins
What is the time complexity of a binary search algorithm?
O(log n)
O(n)
O(n log n)
O(1)
Which of the following is not a type of sorting algorithm?
Data Compression
Merge Sort
Quick Sort
Binary Search
In a flowchart, what does a diamond shape represent?
A decision point or branching in the flow.
A process step in the flow.
An end point in the flow.
A start point in the flow.
What is the output of the following C code: int main() { printf('%d', 5 + 3); return 0; }?
Runtime error
Compilation success
Output: 8
Compilation error
Which of the following is a valid variable name in C?
1varname
varname!
var-name
var_name1
What is the purpose of a flowchart in programming?
To replace the need for programming languages
The purpose of a flowchart in programming is to illustrate the sequence of operations and decision points in a program.
To serve as a user interface design tool
To provide a detailed code implementation
Which operator is used for logical AND in C?
||
&&
and
&
What is the first step in designing an algorithm?
Test the algorithm thoroughly.
Choose a programming language.
Write the code immediately.
Define the problem clearly.
In C programming, what does the 'return 0;' statement signify?
Signifies the start of the program execution.
Indicates an error in the program.
Marks the end of a function without returning a value.
Indicates successful program termination.
What is the correct syntax for a for loop in C?
for(initialization, condition, increment) { // code to execute }
for(initialization; condition; increment) { // code to execute }
for(initialization; increment; condition) { // code to execute }
for(condition; initialization; increment) { // code to execute }
Which of the following is a characteristic of an algorithm?
An algorithm must be finite.
An algorithm must be random.
An algorithm requires human intervention to execute.
An algorithm can be infinite.
What does a rectangle represent in a flowchart?
A decision point in the process.
A connector between different flowchart elements.
A process or operation.
An input or output operation.
