NEW
Font size
WorksheetsC Language and Data Structures Quiz
Total questions: 30
Worksheet time: 15mins
Which of the following is the correct syntax to declare a pointer in C?
int *ptr;
int ptr*;
int &ptr;
pointer int ptr;
What will be the output of this code?
#include
11
12
10
Undefined behavior
Which header file is needed to use the printf function?
stdlib.h
stdio.h
string.h
conio.h
What is the size of int on a typical 32-bit system?
2 bytes
4 bytes
8 bytes
Compiler dependent
What will be the output of the following code?
#include
True
False
Compilation error
Runtime error
Which operator is used to access the value at the address stored in a pointer?
&
*
->
.
What is the output of the following code?
#include
H
e
o
l
Which of the following is a loop in C?
repeat-until
loop...end
for
foreach
Which data type is used to create a variable that should store text (string)?
char[]
string
str
text
What will be the result of sizeof(char) in C?
1
2
4
Depends on system
Which data structure uses LIFO (Last In First Out) order?
Queue
Stack
Array
Linked List
What is the time complexity of searching in a balanced binary search tree (BST)?
O(1)
O(n)
O(log n)
O(n log n)
Which of the following data structures is used in Breadth-First Search (BFS) of a graph?
Stack
Queue
Priority Queue
Tree
Which data structure is most suitable for implementing recursion?
Queue
Heap
Stack
Tree
Which of the following is not a linear data structure?
Array
Stack
Linked List
Tree
In a circular queue, how do you check if the queue is full?
front == rear
(rear + 1) % size == front
rear == size - 1
rear == -1
Which data structure allows insertion and deletion only from one end?
Deque
Queue
Stack
Array
What is the worst-case time complexity of QuickSort?
O(n log n)
O(n²)
O(log n)
O(n)
Which traversal method is used to get the contents of a BST in sorted order?
Pre-order
In-order
Post-order
Level-order
Which of the following is the best data structure for implementing a priority queue?
Stack
Queue
Heap
Linked List
What does HTML stand for?
Hyper Trainer Marking Language
Hyper Text Markup Language
Hyper Text Marketing Language
Hyper Text Mark Language
Which of the following is not an operating system?
Windows
Linux
Oracle
MacOS
What is the main function of an operating system?
Compiling programs
Controlling hardware and software resources
Creating web pages
Managing databases
In MS Word, which shortcut is used to bold the selected text?
Ctrl + I
Ctrl + B
Ctrl + U
Ctrl + P
What does the command git init do in Git?
Deletes the repository
Creates a new repository
Updates a file
Clones a repository
Which language is used for styling web pages?
HTML
CSS
Java
Python
In MS Excel, what does the function =SUM(A1:A5) do?
Multiplies A1 to A5
Adds cells A1 to A5
Subtracts A5 from A1
Finds the average
What is the default port number for HTTP?
21
25
80
443
Which of the following is a version control system?
Git
Chrome
Excel
Docker
What does CPU stand for?
Central Process Unit
Central Processing Unit
Control Processing Unit
Central Peripheral Unit
