Department of Computer Science and Engineering
INTERNAL TEST - I
Semester: III Session: July – Dec 2021
Course Name: Data Structure using C Course Code: 18CSI301
Date: 24-09-2021 Max Marks: 100
Time: 9:30 PM – 12:30 PM Duration: 3 Hours
Note:
i. All questions are compulsory.
ii. All questions carry 10 marks.
iii. Missing data can be assumed suitably.
Bloo
Q Mar CO’
Questions m’s
# ks s
Level
1. i Identify the statement having the disadvantage of arrays? 1 CO1 L2
a. It can be used to store multiple values of similar type.
b. There are chances of wastage of memory space if elements
inserted in an array are lesser than the allocated size.
c. In an array, accessing an element is very easy by using the index
number.
d. It allows us to store known number of elements in it.
ii Point out the correct way to initialize an array in C? 1 CO1 L2
a. int arr[3] = (1,2,3);
b. int arr(3) = {1,2,3};
c. int arr[3] = {1,2,3};
d. int arr(3) = (1,2,3);
iii Use the following C code to obtain the output? 1 CO1 L3
Page 1 of 7
, Department of Computer Science and Engineering
a.10
b. Compile time error
c. Segmentation fault/runtime crash since pointer to local variable is
returned
d. Undefined behavior
iv Identify the correct comment on the following pointer declaration? 1 CO1 L2
int *ptr, p;
a) ptr is a pointer to integer, p is not
b) ptr and p, both are pointers to integer
c) ptr is a pointer to integer, p may or may not be
d) ptr and p both are not pointers to integer
v Which of the following header files must necessarily be included to use 1 CO1 L1
dynamic memory allocation functions?
a) stdlib.h
b) stdio.h
c) memory.h
d) dos.h
vi Consider the following user defined data type and tell the maximum size 1 CO2 L2
occupied by the data?
Union Data
{
int i;
Page 2 of 7
INTERNAL TEST - I
Semester: III Session: July – Dec 2021
Course Name: Data Structure using C Course Code: 18CSI301
Date: 24-09-2021 Max Marks: 100
Time: 9:30 PM – 12:30 PM Duration: 3 Hours
Note:
i. All questions are compulsory.
ii. All questions carry 10 marks.
iii. Missing data can be assumed suitably.
Bloo
Q Mar CO’
Questions m’s
# ks s
Level
1. i Identify the statement having the disadvantage of arrays? 1 CO1 L2
a. It can be used to store multiple values of similar type.
b. There are chances of wastage of memory space if elements
inserted in an array are lesser than the allocated size.
c. In an array, accessing an element is very easy by using the index
number.
d. It allows us to store known number of elements in it.
ii Point out the correct way to initialize an array in C? 1 CO1 L2
a. int arr[3] = (1,2,3);
b. int arr(3) = {1,2,3};
c. int arr[3] = {1,2,3};
d. int arr(3) = (1,2,3);
iii Use the following C code to obtain the output? 1 CO1 L3
Page 1 of 7
, Department of Computer Science and Engineering
a.10
b. Compile time error
c. Segmentation fault/runtime crash since pointer to local variable is
returned
d. Undefined behavior
iv Identify the correct comment on the following pointer declaration? 1 CO1 L2
int *ptr, p;
a) ptr is a pointer to integer, p is not
b) ptr and p, both are pointers to integer
c) ptr is a pointer to integer, p may or may not be
d) ptr and p both are not pointers to integer
v Which of the following header files must necessarily be included to use 1 CO1 L1
dynamic memory allocation functions?
a) stdlib.h
b) stdio.h
c) memory.h
d) dos.h
vi Consider the following user defined data type and tell the maximum size 1 CO2 L2
occupied by the data?
Union Data
{
int i;
Page 2 of 7