wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Basic C Programming

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

Every C Program Statement must be terminated with a

a)

.

b)

#

c)

;

d)

!

2.

What does the following code fragment write to the monitor?

a)

Under

b)

Over

c)

Under the limit

d)

Over the limit

3.

What does the following code fragment write to the monitor?

a)

Under

b)

Over

c)

Under the limit

d)

Over the limit

4.

What does the following code fragment write to the monitor?

a)

You win

b)

You lose

c)

You win the prize.

d)

You lose the prize.

5.

Evaluate(to true or false) each of the following expressions:

(1) 14 <= 14

(2) 14 < 14

a)

false false

b)

true true

c)

true false

d)

false true

6.

Which of the following is the boolean operator for logical-AND?

a)

&

b)

&&

c)

|

d)

||

7.

Which data type is incorrect?

a)
int
b)
double
c)
float
d)
array
8.

Which of the following is not a valid C variable name?

a)

int number;

b)

float rate;

c)

int variable_count;

d)

int $main;

9.

Which of the following is not a logical operator?

a)

&&

b)

!

c)

||

d)

|

10.

What is the output of the following code?

a)

5

b)

10

c)

15

d)

20

11.

What is the output of the following code?

a)

0

b)

5

c)

10

d)

15

12.

What is the output of the following code?

a)

a is greater than b

b)

b is greater than a

c)

a and b are equal

13.
What does this shape represent?
a)
Decission
b)
Process
c)
Input/Output
d)
Start/End
14.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
15.
What does this symbol mean?
<
a)
Greater Than
b)
Less Than
16.

When you would like to read a temperature, a/an _____ should be created to store the temperature data

a)

input

b)

output

c)

notation

d)

variable