wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Understanding Source Code and Functions

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

How is source code different from executable code?

a)

Source code runs faster than executable code

b)

Executable code is human-readable, while source code is binary

c)

They are the same thing

d)

Source code is written by humans, executable code is generated by compilers

2.

What is source code?

a)

The machine-readable code that the CPU executes

b)

Human-readable instructions written in a programming language (plain-text)

c)

Binary numbers only

d)

A special type of comment in C

3.

Do standard functions or main need to have a function description?

a)

Only user defined functions require a description

b)

Only main requires a description

c)

No, neither require a description

d)

Yes, both require a description

4.

Variable names don’t need to convey meaning or follow standards.

a)

True

b)

 False

5.

To follow standards, does a programmer provide a function description to the main function?

a)

Yes, always

b)

No, main does not require a function description

c)

Only in C++

d)

 Only if the program has more than one function

6.

The functions supplied in the stdio.h library allow for what?

a)

Mathematical calculations

b)

Variable declarations

c)

File encryption

d)

 Input and output operations

7.

If the incorrect specifier is used for an output specification, what can happen?

a)

The program might crash or display incorrect data

b)

Nothing, the program runs normally

c)

The variable automatically converts to the correct type

d)

The compiler fixes the mistake

8.

Does an output specifier change the way data is stored in the program or computer?

a)

Yes, but only for integers

b)

No, it only changes how the data is displayed

c)

Yes, it changes how memory stores the data

d)

Yes, but only when using floats

9.

What are the three types of errors a program can contain?

a)

Logic, integer, compiler

b)

Syntax, runtime, logic

c)

Compiler, binary, pointer

d)

Input, output, syntax

10.

What is a defined constant that uses the #define syntax?

a)

A variable that changes its value during program execution

b)

A symbolic name that represents a fixed value

c)

A function that returns a constant

d)

An integer declared in main