WorksheetsMidterm Exam - L1
Total questions: 34
Worksheet time: 40mins
What is a programming language?
A software tool
A set of rules and instructions
A machine-readable code
A compiler
Who is the creator of the C programming language?
Linus Torvalds
Bill Gates
Dennis Ritchie
Tim Berners-Lee
What does a compiler do?
Executes a program
Translates source code into machine-readable code
Writes source code
Debugs code
Which of the following is an example of an IDE?
Compiler
Debugger
Visual Studio Code
Header file
What is the purpose of source code in programming?
It is machine-readable code.
It is used for debugging.
It is human-readable code.
It is used for documentation.
Which file extension is commonly used for C source code files?
.exe
.cpp
.h
.c
What are variables in programming used for?
Writing comments
Storing data during program execution
Declaring functions
Creating loops
Which of the following is a data type in C?
header file
main function
variable
float
What does "declaration" mean in C programming?
Giving a value to a variable
Starting a program
Specifying the data type and name of a variable
Creating a loop
Which symbol is used for assignment in C programming?
+
=
*
/
What are operators in C used for?
Reading input from the user
Defining functions
Performing operations on variables and values
Writing comments
What is the purpose of a function in C programming?
To store data
To write comments
To perform a specific task and modularize code
To declare variables
What is a library in C programming?
A collection of pre-written functions and header files
A set of rules for naming variables
A type of loop
A debugging tool
What does "syntax" refer to in C programming?
The set of rules for naming variables
The set of rules for how C code should be structured
The type of data a variable can hold
The output of a program
What is the purpose of debugging in programming?
To write code faster
To identify and fix errors or bugs in a program
To execute a program
To create variables
What is the process of translating source code into machine-readable code called?
Debugging
Execution
Compilation
Declaration
What is the purpose of executable code in programming?
It is used for documentation.
It is the human-readable code.
It is machine-readable code that can be executed.
It is used for debugging.
Which programming language is known for its simplicity and efficiency?
Python
C++
Java
C
What is the file extension commonly used for header files in C?
.cpp
.c
.h
.exe
Which of the following is NOT a valid C data type?
int
string
float
char
What is the purpose of including header files in a C program?
To declare functions
To create loops
To store data
To write comments
In C programming, what is the role of the main function?
To print text to the console
To initialize variables
To perform the primary task of the program
To declare functions
What is the primary use of variables in programming?
To execute code
To store data during program execution
To write comments
To create loops
Which data type is used for storing whole numbers in C?
float
double
int
char
What does the assignment operator (=) do in C programming?
Adds two numbers
Compares two values
Assigns a value to a variable
Declares a variable
What is the primary purpose of a function in programming?
To create loops
To declare variables
To perform a specific task and organize code
To write comments
What happens when syntax rules are violated in C programming?
The program runs faster.
The program crashes.
Syntax errors occur.
Debugging is not required.
What is the process of identifying and fixing errors or bugs in a program called?
Compilation
Execution
Debugging
Declaration
What is the purpose of the compile step in programming?
To execute the program
To identify syntax errors
To translate source code into machine-readable code
To create variables
What is executable code in programming?
Code written in a high-level language
Machine-readable code that can be executed
Comments in the code
Code used for debugging
Write "No error" if there is no error in the code or provide the line of corrected code if there is an error.
(a)
Write "No error" if there is no error in the code or provide the line of corrected code if there is an error.
(a)
Write "No error" if there is no error in the code or provide the line of corrected code if there is an error.
(a)
Provide the expected output of this program.
(a)
