wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PT-5 Midterm

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

Who is the creator of the C programming language?

a)
Linus Torvalds
b)
James Gosling
c)
Dennis Ritchie
d)
Bjarne Stroustrup
2.

In which year was the C programming language developed?

a)
1972
b)
1975
c)
1965
d)
1980
3.

The preprocessor directive that includes the standard input/output library.

a)

import <stdio.h>

b)

main()

c)

#include <stdio.h>

d)
#include
4.

The function used for printing output to the console.

a)

print()

b)

display()

c)

output()

d)

printf()

5.

A _______ is a named storage location for data.

a)
variable
b)
reference
c)
parameter
d)
constant
6.

it is a variable naming convention where each word is in lower case, and separated by underscores. It is also known as pothole_case

a)
camelCase
b)
kebab-case
c)
PascalCase
d)
snake_case
7.

It is a variable naming convention that the first letter of the first word is lowercase, and the first letter of each subsequent word is capitalized. There are no underscores.

a)
camelCase
b)
kebab-case
c)
snake_case
d)
PascalCase
8.

This is a variation of camel case where the first letter of every word, including the first, is capitalized.

a)

Snake Case

b)

Camel Case

c)

Kebab Case

d)
Pascal Case
9.

These data type are used to store whole numbers. They can be signed (positive, negative, and zero) or unsigned (positive and zero only).

a)
String
b)
Float
c)
Integer
d)
Boolean
10.

These data type are used to store numbers with decimal points. They are also known as real numbers.

a)
Floating-point numbers
b)

Whole numbers

c)

string

d)

Integer

11.

These data type are used to store a single character, such as a letter, number, or symbol.

a)
string
b)
byte
c)
integer
d)
char
12.

An _____ in C is a collection of elements of the same data type stored in contiguous memory locations.

a)
collection
b)
set
c)
array
d)
list
13.

In C, a string is a one-dimensional array of characters terminated by the null character. What is the character '\0' called?

a)
character array
b)
null character
c)
string terminator
d)
end character
14.

It informs the compiler about the type of data to expect or display, ensuring variables are interpreted and shown correctly. These specifiers start

with a percent sign (%) followed by a character (or characters) that indicates the data type.

a)
type indicators
b)
format specifiers
c)
variable specifiers
d)
data types
15.

What data type does %d represent?

a)
String
b)
Integer
c)
Float
d)
Boolean
16.

What data type does %f represent?

a)

integer

b)

string

c)

float

d)

boolean

17.

What data type does %c represent?

a)
String
b)
Integer
c)
Boolean
d)
Character
18.

What data type does %s represent?

a)
string
b)
float
c)
boolean
d)
integer
19.

In C it is one of the commonly used function to take input from the user.

a)

printf()

b)

scanf()

c)

input()

d)
read()
20.

What does the symbol > represent?

a)
greater than
b)
not equal to
c)
equal to
d)
less than
21.

What does the symbol < represent?

a)
greater than
b)
equal to
c)
less than
d)
not equal to
22.

What does the symbol != represent?

a)
not equal to
b)
less than
c)
greater than
d)
equal to
23.

What does the symbol >= represent?

a)
Equal to or less than
b)
Less than or equal to
c)
Greater than
d)
Greater than or equal to
24.

What does the symbol <= represent?

a)

Greater than or Equal to

b)

Less than

c)

Greater than

d)

Less than or Equal to

25.

What does the symbol == represent?

a)

Equal to

b)

Equal

c)
Comparison operator
d)
Assignment operator
26.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
Should Drink
b)
Can Drink
c)
Can Not Drink
d)
Must Drink
27.

What does "\n" represent for?

a)
newline character
b)
line break character
c)
space character
d)
tab character
28.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
Positive number
b)
Negative number
c)
Undefined output
d)

Error

29.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
Zero value
b)
Negative number
c)
Positive number
d)
Undefined output
30.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
False
b)
Undefined
c)
Error
d)
True
31.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)

4 16 24 40
Sum = 88

b)

4 8 12 16 20 24 28 32 36 40
Sum = 220

c)
Sum = 154
d)
Sum = 140
32.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)

b)

c)

d)

33.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)

b)

c)

d)

34.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)

b)

c)

d)

35.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
1
b)
7
c)
0
d)
-1
36.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
Sum = 37
b)
Sum = 42
c)
Sum = 25
d)
Sum = 30
37.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
Sum = 9
b)
Sum = 12
c)
Sum = 6
d)
Sum = 5
38.

What is the output of the following C code snippet, if the user enter 4 rows and 3 columns?

(Click the image to view it clearly)

a)

b)

c)

d)

39.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
0
b)

120000

c)

120000000

d)

200

40.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
150
b)
100
c)
200
d)
250
41.

What is the output of the following C code snippet, if the user input 20?

(Click the image to view it clearly)

a)
50
b)
80
c)
100
d)
200
42.

What is the output of the following C code snippet, if user input 10?

(Click the image to view it clearly)

a)
75
b)
85
c)
90
d)
100
43.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)

1 2 3 4 6 7 8 9 11 12 13 14

Sum: 90

b)

5 10 15

Sum: 30

c)

30

d)

90

44.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)

Hello, World!

Hello, World!

b)

Hello, World!,

Hello, World!

c)

Hello, World!

Hello, World!

Hello, World!

d)

Hello, World!,

Hello, World!,

Hello, World!,

45.

What is the output of the following C code snippet?

(Click the image to view it clearly)

a)
Factorial: 720
b)
Factorial: 360
c)
Factorial: 504
d)
Factorial: 120
46.

The _____ statement ends the loop immediately when it is encountered.

a)
exit
b)
continue
c)
break
d)
return
47.

The _______ statement skips the current iteration of the loop and continues with the next iteration.

a)
break
b)
exit
c)
return
d)
continue
48.

What are the three types of loops used in C programming?

a)
foreach loop, repeat loop, until loop
b)
loop for, loop while, loop do while
c)
for each loop, loop until, loop repeat
d)
for loop, while loop, do while loop
49.

What is the purpose of % operator or Modulo division?

a)
The % operator determines the average of two values.
b)
The % operator calculates the total of a division operation.
c)
The % operator is used to multiply two numbers together.
d)
The purpose of the % operator is to find the remainder of a division operation.
50.

In C if the body of an if...else statement has only one statement, do you need brackets?

a)

No

b)

Yes,