wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DS - QUIZ 1

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which of the following is a conditional statement?

a)

 Select

b)

If

c)

For

d)

while

2.

  Which of the following cannot be checked in a switch-case statement?

a)

Character

b)

Integer

c)

Float

d)

enum

3.

Which of the following data types can be used in a switch-case statement?

a)

Boolean

b)

Array

c)

String

d)

Double

4.

What is the output of the following code snippet if the condition is true?

a)

Error

b)

False

c)

True

d)

Undefined

5.

Which of the following statements is used to exit a loop prematurely?

a)

Exit

b)

Continue

c)

Break

d)

Return

6.

The function that calls itself for its processing is known as                                                                     

a)

Inline Function

b)

Nested Function

c)

Overloaded Function

d)

Recursive Function

7.

Which data structure stores dissimilar data together?

a)

Array

b)

Stack

c)

Structure

d)

None of the above

8.

The smallest element of an array's index is called its

a)

Lower Bound

b)

Upper Bound

c)

Range

d)

Extraction

9.

Choose a correct statement about C language arrays.

a)

An array size can not changed once it is created

b)

Array element value cannot be changed

c)

c)    An array occupies memory discontinuously

d)

c)     None of the above

10.

An array Index starts with.?

a)

0

b)

1

c)

-1

d)

2

11.

  How   many   bytes   will   an   integer   pointer          moves  when   it       is incremented?

a)

1

b)

2

c)

4

d)

8

12.

  Function used to allocate memory to an array at run time with Zero initial value?

a)

malloc()

b)

calloc()

c)

realloc()

d)

palloc()

13.

What is the value of an array element which is not initialized.?

a)

By default Zero 0

b)

1

c)

Depends on Storage Class

d)

Depends on compiler

14.

          What happens when you try to access an array variable outside its Size.?

a)

Compiler error is thrown

b)

0 value will be returned

c)

1 value will be returned

d)

Returns garbage value

15.

            A multidimensional array of dimension N is a collection of.?

a)

One Dimensional Arrays

b)

N-1 dimensional arrays

c)

N dimension arrays

d)

N-2 dimension arrays

16.

   Choose  a  correct  Syntax  for  malloc()  function  to  allocate

memory to an array at run time.

a)

int p; p = (int)malloc(10*sizeof(int));

b)

int p; p = (int)malloc(10,sizeof(int));

c)

c)    int p; p = (int)malloc(sizeof(int), 10);

d)

int p; p = (int)malloc(10*sizeof(int *));

17.

                   What is the dimension of the C array int array[10][5].?

a)

1

b)

10

c)

3

d)

2

18.

    A mathematical-model with a collection of operations defined

on thatmodel is called

a)

Data Structure

b)

Abstract Data Type

c)

Primitive Data Type

d)

Algorithm

19.

                Representation of data structure in memory is known as                                                              

a)

Recursive

b)

Storage structure

c)

File structure

d)

Abstract Data Type

20.

                Which of the following is true about the characteristics of

abstract data types? i) It exports a type. ii) It exports a set of operations

a)

True, False

b)

False, True

c)

True, True

d)

False, False