Programming for Problem Solving - Unit-3
AA data structure that can hold multiple data types.
BA collection of elements with the same data type.
CA mathematical function.
DA loop construct.
Correct AnswerA collection of elements with the same data type.
Aint[] myArray;
Barray<int> myArray;
Cint myArray[];
Darray myArray;
Correct Answerint myArray[];
AmyArray[2]
BmyArray[3]
CmyArray[1]
DmyArray(3)
Correct AnswermyArray[2]
Correct Answerfor
Aarray[2][3]
Barray[1][2]
Carray(2,3)
Darray[3][2]
Correct Answerarray[1][2]
A10
B20
C30
DNone of the above
Correct Answer20
Correct Answer4
Correct Answer20
Asizeof(arr) / sizeof(arr[0])
Bsizeof(arr)
Carr.size()
DNone of the above
Correct Answersizeof(arr) / sizeof(arr[0])
AIt returns a default value
BIt causes a segmentation fault
CIt wraps around to the start of the array
DNone of the above
Correct AnswerIt causes a segmentation fault
AAn array that can store only two elements.
BAn array of arrays, organized in rows and columns.
CAn array with two data types.
DA data structure to hold strings.
Correct AnswerAn array of arrays, organized in rows and columns.
AIt can store any data-type
BIt only stores element of similar data type to first element
CIt acquires the data type with the highest precision in it
DYou cannot have an array of void data type
Correct AnswerYou cannot have an array of void data type
Fill in the Blanks
26An array is a collection of elements of the __________ data type.
Correct Answersame
27The first index of an array in C is __________.
Correct Answer0
28The last valid index of an array of size 10 is __________.
Correct Answer9
29The declaration int a[5]; creates an array with __________ elements.
Correct Answer5
30An array with rows and columns is called a __________-dimensional array.
Correct Answertwo
31The header file used for string functions is __________.
Correct Answerstring.h
32A string in C is terminated by: __________.
Correct Answer'\0'
33The function used to find the length of a string is __________.
Correct Answerstrlen()
34The function used to copy a string is __________.
Correct Answerstrcpy()
35The function used to concatenate two strings is __________.
Correct Answerstrcat()
36The function used to compare two strings is __________.
Correct Answerstrcmp()
37The function commonly used to read a line of text safely into a character array is __________.
Correct Answerfgets()
38The keyword used to define an enumerated type is __________.
Correct Answerenum
39An array passed to a function is generally treated as a __________ to its first element.
Correct Answerpointer
40Arrays that store related information at corresponding indexes are called __________ arrays.
Correct Answerparallel
41To access the first element of a two-dimensional array arr, you use the syntax __________.
Correct Answerarr[0][0]