Data Structure Quiz 1.1

Data Structure Quiz 1.1

Join Telegram to get Updated: Click Here


Choose a correct statement about C language arrays.
a. An array size must be declared if not initialized immediately.
b. Array size is the sum of sizes of all elements of the array
c. An array address is the address of first element of array itself.
d. All the above


In array Index starts with.?
a. 2
b. 1
c. -1
d. 0


What is the output of C program with arrays.?
int main()
{
int ary(3)=[20,30,40];
printf(“%d”, a(1));
}
a. 0
b. Compiler error
c. 30
d. 20


A string elements are always stored in.?
a. Alternate memory locations
b. Sequential memory locations
c. Random memory locations
d. None of the above


What is the value of an array element which is not initialized.?
a. Depends on Storage Class
b. None of the above.
c. 1
d. By default Zero 0


What are the Types of Arrays.?
a. All the above
b. int, long, float, double
c. char
d. struct, enum


What is an Array?
a. A group of elements of same data type.
b. An array contains more than one element
c. Array elements are stored in memory in continuous or contiguous locations.
d. All the above.


What is the output of C program with arrays ?
int main()
{
int size=4;
int a[size];
a[0]=5;a[1]=6;
a[2]=7;a[3]=8;
printf(“%d %d”, *(a+2), a[1]);
}
a. 76
b. 86
c. Compiler error
d. 66


What is the output of C Program with arrays.?
int main()
{ int rollno[3]=[1001,1002,1003];
printf(“%d”, rollno[1]);
}
a. 1003
b. address of 1002
c. Compiler error
d. 1002

See also  Data Structure Quiz 1.2

Which of these best describes an array?
a. A data structure that shows a hierarchical behavior
b. Arrays are immutable once
c. Container of objects of similar types
d. Array is not a data structure


More From NPTEL: Click Here