wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming in C language

Total questions: 18

Worksheet time: 12mins

Name
Class
Date
1.

What is the output given by this C code?

a)

3210

b)

321

c)

Compiler error

d)

3

2.

In C programming language, what is the symbol II?

a)

Arithmetic operator

b)

This symbol is unrecognised in C

c)

Logical operator

d)

This is the name typically given to an int variable

3.

Fill the blank: instruction _____ is used to provide a value to the instruction that called a function

a)

result

b)

return

c)

exit

d)

break

4.

In C variables can ONLY be declared as numeric?

a)

TRUE

b)

FALSE

5.

Which instruction will print on the screen exactly the text \n?

a)

printf(“n\”);

b)

printf(“n”);

c)

printf(“\\n”);

d)

printf(“\n”);

6.
a)

a=5, b=3, 0

b)

a=5, b=3, c=4

c)

a=5, b=3

d)

Compiler error

7.

Which symbol always finalizes an instruction in C code?

(a)  

8.

Is this code correct? (no errors or warnings)

a)

No, the name myprint is not correct

b)

Yes, there is no problem at all

c)

No, if it indicates int in the signature, a value should be returned

d)

Yes, but k is printed as a double number

9.

What is a pointer in C?

a)

Any element in a C program

b)

It refers to the memory address of a variable

c)

It is exactly a regular variable

d)

It is a specific kind of function

10.

Which instruction is for choosing among multiple options depending on the value of a single variable? (Just one word in lowercase)

(a)  

11.

A single-line comment in C starts by...

a)

/*

b)

//

c)

;

d)

:

12.

Fill the gap: A _______ variable, declared in a function, will only be available for that function

a)

local

b)

global

c)

fake

d)

lazy

13.

Fill the gap: If a parameter received by a function could be changed, pass-by-__________ is necessary

a)

value

b)

reference

c)

free

14.

One _________ is a derived datatype, built using several elements which could be from distinct datatype

a)

loop

b)

array

c)

include

d)

struct

15.

The collection of multiple elements of the same nature and linearly indexed under the same name is called...

a)

struct

b)

array

c)

matrix

d)

variable

16.

Could we assign a float variable to a long integer in C?

a)

YES

b)

NO

17.

When inside a function a call to itself is done we call it...

a)

Iteration

b)

Reiteration

c)

Recursion

d)

This is forbidden

18.

One constant is…

a)

Procedure/function which always does the same

b)

Global variable all functions can use

c)

Global variable all procedures can use

d)

Value which can not be modified after its declaration