Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Midterm Exam - L1

Total questions: 34

Worksheet time: 40mins

Name
Class
Date
1.

What is a programming language?

a)

A software tool

b)

A set of rules and instructions

c)

A machine-readable code

d)

A compiler

2.

Who is the creator of the C programming language?

a)

Linus Torvalds

b)

Bill Gates

c)

Dennis Ritchie

d)

Tim Berners-Lee

3.

What does a compiler do?

a)

Executes a program

b)

Translates source code into machine-readable code

c)

Writes source code

d)

Debugs code

4.

Which of the following is an example of an IDE?

a)

Compiler

b)

Debugger

c)

Visual Studio Code

d)

Header file

5.

What is the purpose of source code in programming?

a)

It is machine-readable code.

b)

It is used for debugging.

c)

It is human-readable code.

d)

It is used for documentation.

6.

Which file extension is commonly used for C source code files?

a)

.exe

b)

.cpp

c)

.h

d)

.c

7.

What are variables in programming used for?

a)

Writing comments

b)

Storing data during program execution

c)

Declaring functions

d)

Creating loops

8.

Which of the following is a data type in C?

a)

header file

b)

main function

c)

variable

d)

float

9.

What does "declaration" mean in C programming?

a)

Giving a value to a variable

b)

Starting a program

c)

Specifying the data type and name of a variable

d)

Creating a loop

10.

Which symbol is used for assignment in C programming?

a)

+

b)

=

c)

*

d)

/

11.

What are operators in C used for?

a)

Reading input from the user

b)

Defining functions

c)

Performing operations on variables and values

d)

Writing comments

12.

What is the purpose of a function in C programming?

a)

To store data

b)

To write comments

c)

To perform a specific task and modularize code

d)

To declare variables

13.

What is a library in C programming?

a)

A collection of pre-written functions and header files

b)

A set of rules for naming variables

c)

A type of loop

d)

A debugging tool

14.

What does "syntax" refer to in C programming?

a)

The set of rules for naming variables

b)

The set of rules for how C code should be structured

c)

The type of data a variable can hold

d)

The output of a program

15.

What is the purpose of debugging in programming?

a)

To write code faster

b)

To identify and fix errors or bugs in a program

c)

To execute a program

d)

To create variables

16.

What is the process of translating source code into machine-readable code called?

a)

Debugging

b)

Execution

c)

Compilation

d)

Declaration

17.

What is the purpose of executable code in programming?

a)

It is used for documentation.

b)

It is the human-readable code.

c)

It is machine-readable code that can be executed.

d)

It is used for debugging.

18.

Which programming language is known for its simplicity and efficiency?

a)

Python

b)

C++

c)

Java

d)

C

19.

What is the file extension commonly used for header files in C?

a)

.cpp

b)

.c

c)

.h

d)

.exe

20.

Which of the following is NOT a valid C data type?

a)

int

b)

string

c)

float

d)

char

21.

What is the purpose of including header files in a C program?

a)

To declare functions

b)

To create loops

c)

To store data

d)

To write comments

22.

In C programming, what is the role of the main function?

a)

To print text to the console

b)

To initialize variables

c)

To perform the primary task of the program

d)

To declare functions

23.

What is the primary use of variables in programming?

a)

To execute code

b)

To store data during program execution

c)

To write comments

d)

To create loops

24.

Which data type is used for storing whole numbers in C?

a)

float

b)

double

c)

int

d)

char

25.

What does the assignment operator (=) do in C programming?

a)

Adds two numbers

b)

Compares two values

c)

Assigns a value to a variable

d)

Declares a variable

26.

What is the primary purpose of a function in programming?

a)

To create loops

b)

To declare variables

c)

To perform a specific task and organize code

d)

To write comments

27.

What happens when syntax rules are violated in C programming?

a)

The program runs faster.

b)

The program crashes.

c)

Syntax errors occur.

d)

Debugging is not required.

28.

What is the process of identifying and fixing errors or bugs in a program called?

a)

Compilation

b)

Execution

c)

Debugging

d)

Declaration

29.

What is the purpose of the compile step in programming?

a)

To execute the program

b)

To identify syntax errors

c)

To translate source code into machine-readable code

d)

To create variables

30.

What is executable code in programming?

a)

Code written in a high-level language

b)

Machine-readable code that can be executed

c)

Comments in the code

d)

Code used for debugging

31.

Write "No error" if there is no error in the code or provide the line of corrected code if there is an error.

(a)  

32.

Write "No error" if there is no error in the code or provide the line of corrected code if there is an error.

(a)  

33.

Write "No error" if there is no error in the code or provide the line of corrected code if there is an error.

(a)  

34.

Provide the expected output of this program.

(a)