wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ICPTP L1: Programming Languages

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

What is the main function of a compiler?

a)

Translates assembly language into machine code.

b)

Translates high level language into object code.

c)

Translates high level language into machine code.

d)

Translates machine code into high level language.

2.

Which of the following is a syntax error?

a)

Misspelling a statement.

b)

Writing a program that tries to access an array out of bounds.

c)

Using logical operators incorrectly.

d)

Unintentionally using the same variable name at different points.

3.

What is the purpose of a translator in programming languages?

a)

Checks for syntax errors in a program.

b)

Writes an equivalent machine language program.

c)

Analyzes and fixes logical errors.

d)

Identifies and fixes runtime errors.

4.

Which generation of languages is based on solving problems using constraints given to the program?

a)

Fifth

b)

Second

c)

First

d)

Third

5.

What is the main difference between an interpreter and a compiler?

a)

Interpreters create object code for later use, while compilers execute the code immediately.

b)

Interpreters generate error reports after translation, while compilers notify errors and stop further scanning.

c)

Interpreters translate the entire code at once, while compilers translate one statement at a time.

d)

Interpreters take less time to analyze the source code, while compilers take more time.

6.

Which of the following is a logical error?

a)

Division by zero

b)

Syntax error in the code

c)

Incorrectly using logical operators

d)

Trying to access an array out of bounds

7.

What is the purpose of debugging in programming?

a)

Identifying, analyzing, and fixing errors in the code.

b)

Translating high level language into machine code.

c)

Creating object code for later use.

d)

Checking for syntax errors in the program.

8.

Which generation of languages is hardware dependent and easy to understand and execute?

a)

First

b)

Second

c)

Fourth

d)

Third

9.

What is the main function of an assembler?

a)

Translates assembly language into machine code.

b)

Translates high level language into machine code.

c)

Translates machine code into high level language.

d)

Translates high level language into object code.

10.

Which type of language concentrates on what to do rather than how to do it?

a)

Procedural Languages

b)

Non-Procedural Languages

c)

Query Languages

d)

Artificial Languages