Which of the following is used to arrange variables in a specific order Mcq?

Explanation: The answer is c because array stores the elements in a contiguous block of memory of similar types. Therefore, we can say that array is a container that stores the elements of similar types.


2) Which of the following is the correct way of declaring an array?

  1. int javatpoint[10];
  2. int javatpoint;
  3. javatpoint{20};
  4. array javatpoint[10];
Show Answer Workspace

Answer: a

Explanation: The answer is a because int specifies the type of the array, javatpoint is the name of the array, and 10 is the size of the array enclosed within the square brackets.


3) How can we initialize an array in C language?

  1. int arr[2]=(10, 20)
  2. int arr(2)={10, 20}
  3. int arr[2] = {10, 20}
  4. int arr(2) = (10, 20)
Show Answer Workspace

Answer: c

Explanation: The answer is c because the values assigned to the array must be enclosed within a curly bracket.


4) Which of the following is the advantage of the array data structure?

  1. Elements of mixed data types can be stored.
  2. Easier to access the elements in an array
  3. Index of the first element starts from 1.
  4. Elements of an array cannot be sorted
Show Answer Workspace

Answer: b

Explanation: The answer is b because the elements in an array are stored in a contiguous block of memory, so it is easier to access the elements of an array through indexing.


5) Which of the following highly uses the concept of an array?

  1. Binary Search tree
  2. Caching
  3. Spatial locality
  4. Scheduling of Processes
Show Answer Workspace

Answer: c

Explanation: The answer is c, i.e., Spatial locality. Here, spatial locality means that the instruction accessed recently, then the nearby memory location would be accessed in the next iteration. As we know that in an array, all the elements are stored in a contiguous block of memory, so spatial locality is accessed quickly.


6) Which of the following is the disadvantage of the array?

  1. Stack and Queue data structures can be implemented through an array.
  2. Index of the first element in an array can be negative
  3. Wastage of memory if the elements inserted in an array are lesser than the allocated size
  4. Elements can be accessed sequentially.
Show Answer Workspace

Answer: c

Explanation: The answer is c. Both A and C are the AVL trees but B is not a AVL tree. As we know that balance factor of every node in AVL tree should be either -1, 0 or 1. But in case of B, the balance factor of node 80 is 2, so it is not a AVL tree.

5. If emp_id contain the following set {9, 7, 6, 4, 3, 1, 2}, what will be the output on execution of the following MySQL statement?

advertisement

SELECT emp_id
FROM person
ORDER BY emp_id;

a) {1, 2, 3, 4, 6, 7, 9}
b) {2, 1, 4, 3, 7, 9, 6}
c) {9, 7, 6, 4, 3, 1, 2}
d) None of the mentioned
View Answer

Answer: a
Explanation: “ORDER BY” clause sort the emp_id in the result set.

6. If emp_id contain the following set {1, 2, 3, 4, 1, 1}, what will be the output on execution of the following MySQL statement?

SELECT emp_id
FROM person
ORDER BY emp_id;

a) {1, 1, 1, 2, 3, 4}
b) {1, 2, 3, 4, 1, 1}
c) {1, 1, 2, 3, 4, 1}
d) None of the mentioned
View Answer

Answer: a
Explanation: “ORDER BY” clause sort the emp_id in the result set.

7. If emp_id contain the following set {1, 2, 2, 3, 3, 1}, what will be the output on execution of the following MySQL statement?

SELECT emp_id
FROM person
ORDER BY emp_id;

a) {1, 1, 2, 2, 3, 3}
b) {1, 2, 3, 3, 2, 1}
c) {2, 2, 1, 1, 3, 3}
d) None of the mentioned
View Answer

Answer: a
Explanation: “ORDER BY” clause sort the emp_id in the result set.

8. If emp_id contain the following set {-1, -2, 2, 3, -3, 1}, what will be the output on execution of the following MySQL statement?

SELECT emp_id
FROM person
ORDER BY emp_id;

a) {-3, -2, -1, 1, 2, 3}
b) {-1, 1, -2, 2, -3, 3}
c) {1, 2, 3, -1, -2, -3}
d) None of the mentioned
View Answer

Answer: a
Explanation: “ORDER BY” clause sort the emp_id in the result set.

9. Which keyword is used for sorting the data in descending order in Mysql?
a) DESC
b) ASC
c) ALTER
d) MODIFY
View Answer

Answer: a
Explanation: None.

10. Which keyword is used for sorting the data in ascending order in Mysql?
a) DESC
b) ASC
c) ALTER
d) MODIFY
View Answer

Answer: b
Explanation: None.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

In which type of scale data can be arranged in order?

Nominal scale:.
In this scale, categories are nominated names (hence “nominal”). ... .
The values (not categories) can be ordered and have a meaningful difference, but doubling is not meaningful. ... .
The values can be ordered, have a meaningful difference, and doubling is also meaningful. ... .
The values can be specific numbers only..

Which of the following is the correct order of the four levels of measurement?

Psychologist Stanley Smith is known for developing four levels of measurement: nominal, ordinal, interval, and ratio.

Which of the following variables is measured on the ordinal scale?

Examples of ordinal variables include: socio economic status (“low income”,”middle income”,”high income”), education level (“high school”,”BS”,”MS”,”PhD”), income level (“less than 50K”, “50K-100K”, “over 100K”), satisfaction rating (“extremely dislike”, “dislike”, “neutral”, “like”, “extremely like”).

What are the 4 measurement scales?

The four scales of measurement.
Nominal scale of measurement..
Ordinal scale of measurement..
Interval scale of measurement..
Ratio scale of measurement..