One-dimensional arrays MCQs

By: Prof. Dr. Fazal Rehman | Last updated: May 14, 2025

20
Score: 0
Attempted: 0/20
Subscribe
1. : What is the correct way to declare a one-dimensional array of integers in C?



2. : Which of the following correctly initializes an array of size 5 with all zeros in C++?



3. : What is the index of the last element in an array of size n?



4. : What is the time complexity of accessing an element in a one-dimensional array by its index?



5. : What is the value of the first element in an array initialized as int array[3] = {1, 2, 3};?



6. : How do you pass a one-dimensional array to a function in C?



7. : What is the output of the following code? int array[5] = {1, 2, 3, 4, 5}; printf(“%d”, array[2]);



8. : Which of the following statements about one-dimensional arrays is false?



9. : How can you find the number of elements in an array int array[10]; in C?



10. : What is the initial value of an uninitialized array in C?



11. : Which of the following correctly accesses the third element of an array named data?



12. : Which operation is not typically performed directly on one-dimensional arrays?



13. : In which of the following scenarios is a one-dimensional array preferred over other data structures?



14. : What is the result of the following code? int array[4] = {1, 2}; printf(“%d”, array[3]);



15. : How do you correctly assign the value 10 to the first element of an array arr in Java?



16. : Which of the following statements about arrays in Java is true?



17. : What is the output of the following code in Python? arr = [1, 2, 3, 4, 5]; print(arr[-1])



18. : Which function would you use to find the length of an array arr in Python?



19. : How do you declare an array of 10 integers in JavaScript?



20. : What is the output of the following code? int array[5] = {1, 2, 3, 4, 5}; printf(“%d”, array[5]);



 

 

Data Structures MCQs

Basic Concepts

  1. Introduction to Data Structures
  2. Complexity Analysis MCQs

Linear Data Structures MCQs

  1. Arrays MCQs
  2. Linked Lists MCQs
  3. Stacks MCQs
  4. Queues MCQs

Non-Linear Data Structures MCQs

  1. Trees MCQs
  2. Heaps MCQs
  3. Graphs MCQs

Hashing MCQs MCQs

  1. Hash Tables

Sorting and Searching Algorithms MCQs 

  1. Sorting Algorithms MCQs
  2. Searching Algorithms MCQs

Miscellaneous

  1. Memory Management in data structures MCQs
  2. String Manipulation Algorithms MCQs
  1. Data Structures MCQs 1
  2. Data Structures MCQs 2
  3. Data Structures MCQs 3
  4. Data Structures MCQs 4
  5. Data Structures MCQs 5
  6. Stacks Solved MCQs
  7. Queues MCQs
  8. pointer mcqs
  9. Array MCQs

 

All Copyrights Reserved 2025 Reserved by T4Tutorials