wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz last paper

Total questions: 25

Worksheet time: 18mins

Name
Class
Date
1.

Following are characteristics of imperative paradigm EXCEPT

a)

A. Consists of series of statements

b)

B. Central features are variables, assignment statements and iterations

c)

C Program execution involves changing the memory contents

d)

D Able to execute codes from distributed computing

2.

Following are characteristics of functional paradigm EXCEPT

a)

A. Consists of statements of works

b)

B. Abstraction is in functions

c)

C Program execution involves functions calling each other

d)

D. Simpler paradigm compared to imperative

3.

Which of the statements are TRUE about declarative paradigm characteristics

a)

A. Consists of predicates and rule inference

b)

B. Able to be applied within mathematical formulation

4.

Which of the statements are TRUE about object oriented paradigm characteristics

a)

A. Programming with concrete data types

b)

B. Paradigm concepts include polymorphism and inheritance

5.

What are the compilation phases of any paradigm?

a)

Lexical Analysis

b)

Syntax Analysis

c)

Semantic Analysis

d)

Code Generation

e)

All of above

6.

What are the generations of programming languages?

a)

1GL Machine Code

b)

2GL Symbolic assemblers (101010)

c)

3GL Imperative languages (Human Languages)

d)

4GL Domain specific application generators (eg JAVA)

e)

5GL Al Languages (Machine Learning)

7.

What are language evaluation criteria?

a)

Readability

b)

Writability

c)

Reliability

d)

Cost

e)

All of above

8.

Is the following conversion TRUE or FALSE

a)

TRUE

b)

FALSE

9.

Is the following conversion TRUE or FALSE?

a)

TRUE

b)

FALSE

10.

How many times does the statement "I am a genius" get printed?

a)

10

b)

4

c)

2

d)

0

11.

What is the output of the program?

a)

A. Theatre

b)

B. Theatre

Hurray...

c)

No output

d)

D. Compilation Error

12.

What is the output of the program?

a)

A. 4,3,2,1,0,4

4,5,2,1,0,4

b)

B. 5,4,3,2,1,0

5,4,3,2,1,0

c)

C. Error

d)

D. 5,4,3,2,1,0

5,4,3,2,1,0

5,4,3,2,1,0

13.

If you don't initialize a static array, what will be the element set to?

a)

A. Zero

b)

B. A floating point

c)

C. An undetermined

d)

D. None of above

14.

What is the answer of: 7%3

a)

A. 25

b)

B. 1

c)

C. 2

d)

D. 3

15.

Which is the correct way to declare a pointer?

a)

A. int_ptr;

b)

B. int *ptr;

c)

C. *int ptr;

d)

D. None of above

16.

Maximum number of elements in the array declaration int a [5] [8] is

a)

A. 28

b)

B. 32

c)

C. 35

d)

D. 40

17.

malloc() function used in dynamic allocation available in which header file?

a)

A. stdio.h

b)

B. stdlib.h

c)

C. iostreams.h

d)

D. mem.h

18.

The operator + in a+=4 means

a)

A. a=a+4

b)

B. a+4=a

c)

C. a=4

d)

D. a=4+4

19.

An Ampersand before the name of a variable denotes

a)

A. Actual value

b)

B. Variable name

c)

C. Address

d)

D. Data type

20.

What are the main types of programming paradigm?

a)

Imperative (C language)

Functional (Pascal Language)

b)

Declarative (Prolog)

Object Oriented (Java)

c)

Scripting (Phyton)

Concurrent (Haskell)

d)

None of above

21.

Which operator has the highest priority?

a)

A. ++

b)

B. %

c)

C. +

d)

D. ||

22.

What is the output of the program ?

a)

A. 5

b)

B. 1

c)

C. No output

d)

D. Name error: name 'num' is not defined

23.

What will be the output of the while loop if num = [1,2] ?

a)

A. 1

b)

B. 2

c)

C. 3

d)

D. No output

e)

E. Compilation error

24.

Explain how the output generated

4 lines
25.

Explain below code in your own word

int main()

{

int i = 5;

while(i-- >= 0)

printf("%d,", i);

i=5;

printf("\n");

while(i-->= 0)

printf("%i", i);

while(i-- >= 0)

printf("%d,", i);

return 0;

}

4 lines