MCQ on Arrays in C — 40 Questions with Answers
  • Twitter
  • Facebook
  • Snapchat
  • Instagram

MCQ, Multiple Choice Questions on Arrays in C

📑 On this page:
  • Array Basics
  • One-Dimensional Arrays
  • 1D Array Output Questions
  • Two-Dimensional Arrays
  • Three-Dimensional Arrays
  • Dynamic & Jagged Arrays
  • Arrays and Functions
  • Common Pitfalls
  • Frequently Asked Questions
MCQ on arrays in C including single dimensional array, multi dimensional array, 2D array, and dynamic array questions
MCQ on arrays in C — practice set with answers and simple explanations.
📚 In this quiz, you will revise:
  • How arrays store data in contiguous memory
  • Zero-based indexing and why it exists
  • Declaring, initializing, and accessing 1D arrays
  • 2D and 3D array syntax and row-major layout
  • How arrays are passed to functions (array decay)
  • Dynamic arrays with malloc and free
  • Jagged arrays and why they need pointers
  • Common bugs like out-of-bounds access and sizeof traps

This page has 40 multiple choice questions on arrays in C. You'll find questions on single-dimensional arrays, 2D and 3D arrays, dynamic arrays with malloc and free, jagged arrays, and passing arrays to functions. Each question comes with the correct answer and a short explanation in plain English, so you understand the "why" and not just the "what". These MCQs are useful for beginners preparing for college exams, interviews, or any C programming test. Some questions involve running short code — take them slowly and trace each line in your head.

Array Basics

Q1. Which of the following is true about arrays in C?

  • a) Arrays can store only elements of the same data type
  • b) Arrays can store elements of different data types
  • c) Arrays can be resized dynamically without any library
  • d) Arrays can be passed to functions only by value (copy)

Answer: a) Arrays can store only elements of the same data type

An array in C is a collection of elements that all share one type — int, float, char, or a struct. You cannot mix types in a single array. If you need to store different types together, use a struct. The other options are wrong: arrays are fixed-size, and they decay to pointers when passed to functions (not copied by value).

Q2. How do you declare an array in C to store 10 integers?

  • a) int array[10];
  • b) array_int[10];
  • c) int[10] array;
  • d) int array = [10];

Answer: a) int array[10];

C uses square brackets after the variable name to declare array size. The type comes first, then the name, then the size in brackets. Option c) looks like Java syntax, and option d) is not valid C. Remember: type, name, size — in that order.

Q3. How do you access the third element of an array named numbers in C?

  • a) numbers[3]
  • b) numbers(2)
  • c) numbers{2}
  • d) numbers.3

Answer: numbers[2] (none of the options is fully correct — the closest is a but it's off by one)

This is a classic trap. C arrays are zero-indexed: the first element is at index 0, the second at index 1, and the third at index 2. So the correct answer is numbers[2], not numbers[3]. Option a) would access the fourth element, which is out of bounds if the array has exactly 3 elements. This question is intentionally misleading — be careful in exams. Only square brackets are valid syntax in C (options b, c, d all use wrong symbols).

Q4. What is the index of the first element in an array in C?

  • a) 0
  • b) 1
  • c) -1
  • d) 10

Answer: a) 0

C arrays start at index 0, not 1. So for int arr[5], the valid indices are 0, 1, 2, 3, 4. The reason is that arr[i] is really shorthand for *(arr + i) — pointer arithmetic — and the first element sits at arr + 0. This zero-based rule surprises people coming from languages like MATLAB or Lua, but it's universal in C.

Q5. What is the size of the following array declaration: int numbers[5];?

  • a) 5 elements
  • b) 10 elements
  • c) 20 elements
  • d) The size is not defined

Answer: a) 5 elements

The number in brackets is the number of elements, not the size in bytes. So int numbers[5] holds 5 ints. If you want the size in bytes, use sizeof(numbers), which on a typical system would be 5 × 4 = 20 bytes. Many beginners confuse "elements" with "bytes" — the exam tests this distinction.

Q6. How do you initialize an array in C with values {10, 20, 30, 40, 50}?

  • a) int arr[5] = {10, 20, 30, 40, 50};
  • b) arr_int[] = {10, 20, 30, 40, 50};
  • c) arr{10, 20, 30, 40, 50};
  • d) int arr = {10, 20, 30, 40, 50};

Answer: a) int arr[5] = {10, 20, 30, 40, 50};

C initializes an array with braces and comma-separated values. You may also omit the size and let the compiler count: int arr[] = {10, 20, 30, 40, 50};. Option d) is a common bug — declaring "int arr" (a single int) but assigning braces to it will not compile.

Q7. Which of the following statements is true for arrays in C?

  • a) Arrays can be resized at runtime
  • b) Arrays in C are only passed by reference to functions
  • c) Arrays store elements in a contiguous memory location
  • d) Arrays can store elements of different data types

Answer: c) Arrays store elements in a contiguous memory location

This is the defining property of a C array: elements sit side by side in memory, one after another. That's why pointer arithmetic works — arr + 1 points to the next element. Option b is misleading: arrays are not "passed by reference" in the formal sense — they decay to pointers, which is a different concept. Option a is false (static arrays are fixed), and option d is false (arrays are homogeneous).

Q8. What is the value of numbers[2] after the following initialization?

int numbers[5] = {0};
  • a) 0
  • b) Garbage value
  • c) Error
  • d) 2

Answer: a) 0

In C, when you initialize an array with fewer values than its size, the remaining elements are automatically set to 0. So {0} sets the first element to 0, and the rest (indices 1 through 4) also become 0. This is a handy trick for zero-filling an entire array. If you only declared int numbers[5]; without initializing, the contents would be garbage.

One-Dimensional Arrays

Q9. How do you assign a value of 42 to the second element of an array named ages?

  • a) ages(1) = 42;
  • b) ages[1] = 42;
  • c) ages.2 = 42;
  • d) ages = {42};

Answer: b) ages[1] = 42;

The second element sits at index 1 (because the first is at 0). So ages[1] = 42 stores 42 in the second position. This is one of the most common places where beginners lose marks — mixing up "second element" with "index 2". Remember: second element = index 1.

Q10. How do you find the length of an array in C?

  • a) Using sizeof(arr) / sizeof(arr[0])
  • b) Using the strlen() function
  • c) Using the length() method
  • d) Using the array.length property

Answer: a) Using sizeof(arr) / sizeof(arr[0])

C has no built-in length property like Java or Python. The standard idiom is sizeof(arr) / sizeof(arr[0]) — total bytes divided by bytes per element. This only works when arr is a real array in scope, not a pointer. If arr is a pointer (or an array passed to a function), sizeof(arr) gives the pointer size, and this trick breaks. strlen() is only for null-terminated strings and gives character count, not array length.

Q11. Which of the following is true about the size of an array in C?

  • a) The size of an array must be specified at compile time (for static arrays)
  • b) The size of an array can be changed at runtime
  • c) The size of an array is decided by the number of elements stored in it
  • d) The size of an array can be dynamically allocated

Answer: a) The size of an array must be specified at compile time (for static arrays)

When you declare int arr[10];, the size is fixed the moment the compiler sees it. You cannot later grow or shrink a static array. Dynamic arrays (via malloc) and C99 VLAs are the alternatives, but those are separate topics. Option d) is technically true for dynamic memory but doesn't refer to static arrays — so in this context, option a is the correct "fundamental" statement about static arrays.

1D Array Output Questions

Q12. What is the output of the following code?

int numbers[3] = {1, 2, 3};
printf("%d", numbers[3]);
  • a) 0
  • b) 3
  • c) Garbage value (undefined behaviour)
  • d) Compilation error

Answer: c) Garbage value (undefined behaviour)

The array has valid indices 0, 1, and 2. Accessing numbers[3] is out of bounds — C does not check array limits, so it reads whatever happens to be in the memory just past the array. This is called undefined behaviour. The value could be 0, could be garbage, could crash. Never access indices equal to or beyond the array's size.

Q13. What is the output of the following code?

int arr[5] = {10, 20, 30};
printf("%d %d", arr[2], arr[4]);
  • a) 30 0
  • b) 30 5
  • c) 20 0
  • d) 20 5

Answer: a) 30 0

We initialized only 3 elements, but the array size is 5. In C, the remaining elements (indices 3 and 4) are automatically set to 0. So arr[2] is 30 (the third initialized value) and arr[4] is 0. This "partial initialization zero-fills the rest" behaviour is a very common exam question.

Q14. What is the output of the following code?

int arr[3] = {5, 10, 15};
int sum = 0;
for (int i = 0; i < 3; i++) {
    sum += arr[i];
}
printf("%d", sum);
  • a) 5
  • b) 15
  • c) 30
  • d) 45

Answer: c) 30

The loop visits each element and adds it to sum. 5 + 10 + 15 = 30. This "sum of elements" pattern is the most basic array traversal and appears in nearly every C exam. If you can trace this reliably, you're ready for more complex array output questions.

Two-Dimensional Arrays

Q15. What is the correct syntax to declare a 2D array in C with 3 rows and 4 columns?

  • a) int matrix[3][4];
  • b) array_2d[3,4];
  • c) int[4][3] matrix;
  • d) int matrix = [3][4];

Answer: a) int matrix[3][4];

2D arrays use two sets of square brackets: first for rows, then for columns. The type comes first, name in the middle, dimensions at the end. Option b uses comma syntax (which some other languages allow), option c is invalid C syntax, and option d is invalid. Only option a is valid.

Q16. How do you access the element in row 2, column 3 of a 2D array named matrix? (Assume zero-based indexing.)

  • a) matrix[2][3]
  • b) matrix[1][2]
  • c) matrix(2, 3)
  • d) matrix.2.3

Answer: b) matrix[1][2]

Because C arrays are zero-indexed, "row 2" means index 1 (row 0 is the first), and "column 3" means index 2. So the correct access is matrix[1][2]. Option a) would be the third row and fourth column. This zero-vs-one confusion is the number one mistake in 2D array questions.

Q17. What is the correct way to initialize a 2D array in C with values {{1, 2, 3}, {4, 5, 6}}?

  • a) int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}};
  • b) array_2d = {{1, 2, 3}, {4, 5, 6}};
  • c) matrix{1, 2, 3, 4, 5, 6}
  • d) int matrix = {{1, 2, 3}, {4, 5, 6}};

Answer: a) int matrix[2][3] = {{1, 2, 3}, {4, 5, 6}};

2D arrays are initialized with nested braces: outer braces for the whole array, inner braces for each row. The size [2][3] means 2 rows and 3 columns — matching the 2 inner braces and 3 values each. Option d) is invalid because "int matrix" is a single int, not an array.

Q18. What is the output of the following code?

int matrix[2][2] = {{10, 20}, {30, 40}};
printf("%d", matrix[1][1]);
  • a) 10
  • b) 20
  • c) 30
  • d) 40

Answer: d) 40

matrix[1][1] means row index 1 (the second row) and column index 1 (the second column of that row). The second row is {30, 40}, and its second element is 40. So the output is 40. If you answered 30, you confused row and column indices — remember [row][column], not [column][row].

Q19. Which of the following statements is true for 2D arrays in C?

  • a) 2D arrays are arrays of pointers
  • b) 2D arrays store elements in non-contiguous memory locations
  • c) 2D arrays store rows contiguously in row-major order
  • d) 2D arrays cannot be passed to functions

Answer: c) 2D arrays store rows contiguously in row-major order

A C 2D array is not an array of pointers — it's one flat block of memory where row 0 comes first, then row 1, then row 2, and so on. This is called row-major order. It's why int m[2][3] occupies the same memory as int flat[6], laid out row by row. Option a) is only true for dynamically allocated "arrays of pointers" — not for real 2D arrays.

Three-Dimensional Arrays

Q20. What is the correct way to declare a 3D array in C with dimensions 2×3×4?

  • a) int cube[2][3][4];
  • b) array_3d[2, 3, 4];
  • c) int[4][2][3] cube;
  • d) int cube = [2][3][4];

Answer: a) int cube[2][3][4];

3D arrays follow the same pattern as 2D — three sets of square brackets after the name, one for each dimension. The order [2][3][4] means 2 blocks, 3 rows per block, 4 columns per row. This is often visualised as a cube of numbers, but in memory it's still a flat 1D block of 2×3×4 = 24 ints, laid out contiguously.

Q21. How do you access the element in the second row, third column, and fourth depth of a 3D array named box? (Assume zero-based indexing.)

  • a) box[1][2][3]
  • b) box[2][3][4]
  • c) box(2, 3, 4)
  • d) box.2.3.4

Answer: a) box[1][2][3]

Because C is zero-indexed, "second row" = index 1, "third column" = index 2, "fourth depth" = index 3. So the correct access is box[1][2][3]. Option b) (box[2][3][4]) would be the third row, fourth column, fifth depth — all off by one. This is the same zero-indexing trap in a 3D context.

Q22. What is the correct way to initialize a 3D array in C with values {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}, {{9, 10}, {11, 12}}}?

  • a) int box[3][2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}, {{9, 10}, {11, 12}}};
  • b) array_3d = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}, {{9, 10}, {11, 12}}};
  • c) box{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
  • d) int box = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}, {{9, 10}, {11, 12}}};

Answer: a) int box[3][2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}, {{9, 10}, {11, 12}}};

3D initialization needs three levels of nested braces: outermost for the whole array, then one level per dimension. The size [3][2][2] means 3 blocks, 2 rows per block, 2 columns per row — matching exactly the structure of the initializer. Option d) is invalid because "int box" is a single int.

Q23. What will be the output of the following program?

int box[2][2][2] = {{{1, 2}, {3, 4}}, {{5, 6}, {7, 8}}};
printf("%d", box[1][1][1]);
  • a) 5
  • b) 6
  • c) 7
  • d) 8

Answer: d) 8

box[1][1][1] means: block index 1 (the second block), row index 1 (second row), column index 1 (second element). The second block is {{5, 6}, {7, 8}}. Its second row is {7, 8}. Its second element is 8. So the output is 8. Trace each index carefully — this kind of question tests your ability to follow multiple layers of indexing.

Dynamic & Jagged Arrays

Q24. How do you declare a dynamic array in C?

  • a) int array[];
  • b) int* array = malloc(n * sizeof(int));
  • c) array_int[];
  • d) int array = dynamic;

Answer: b) int* array = malloc(n * sizeof(int));

Dynamic arrays in C are just pointers to memory allocated with malloc (or calloc). You decide the size at runtime, not compile time. Option a) is invalid because you can't leave array size empty in a declaration outside of an initializer. The pointer points to the first element, and you can index it with array[i] like a normal array.

Q25. What is the output of the following code? (Assume a 64-bit system.)

int* array = malloc(5 * sizeof(int));
printf("%d", sizeof(array));
  • a) 5
  • b) 20
  • c) 8 (size of a pointer)
  • d) 40

Answer: c) 8 (size of a pointer)

This is one of the most common traps in C. sizeof(array) returns the size of the pointer variable, not the size of the allocated memory. On a 64-bit system, a pointer is 8 bytes. The allocated block (5 ints = 20 bytes) exists in heap memory, but sizeof doesn't see it. That's why you must track the array length separately when using malloc.

Q26. How do you deallocate memory allocated for a dynamic array named data?

  • a) free(data);
  • b) destroy(data);
  • c) del(data);
  • d) delete(data);

Answer: a) free(data);

Every malloc or calloc must be paired with a free(). This returns the memory to the system, avoiding memory leaks. destroy and del are not C functions (del is Python), and delete is C++, not C. Option a) is the correct answer and one of the C language's most important habits to build.

Q27. Which of the following is true about dynamic arrays in C?

  • a) Dynamic arrays cannot be resized
  • b) Dynamic arrays store elements in non-contiguous memory locations
  • c) Dynamic arrays must be explicitly deallocated after use
  • d) Dynamic arrays are limited to a fixed size

Answer: c) Dynamic arrays must be explicitly deallocated after use

Unlike static arrays, dynamic arrays are not cleaned up automatically by the compiler. You must call free() when done, or you'll have a memory leak. Option a) is false because realloc lets you resize. Option b) is false — malloc gives a contiguous block. Option d) is false because you choose the size at runtime.

Q28. What is the correct way to declare a jagged array in C (array of arrays with different lengths)?

  • a) int** jagged_arr;
  • b) int jagged_arr[][];
  • c) int* jagged_arr[]; (with manual allocation of each row)
  • d) int** jagged_arr[];

Answer: c) int* jagged_arr[]; (with manual allocation of each row)

C doesn't have true jagged arrays like Java. You simulate them using an array of pointers, where each pointer can point to a differently-sized block. Option a) (int**) is also valid syntax, but option c) makes the "array of pointers" intent clearer and is the standard idiom. Options b and d are not valid C. Each row must be allocated separately with malloc.

Q29. How do you access the element in row 2, column 1 of a jagged array named table? (Assume zero-based indexing.)

  • a) table[2][1]
  • b) table[1][0]
  • c) table{2}{1}
  • d) table(2, 1)

Answer: b) table[1][0]

Same zero-indexing rule applies to jagged arrays. "Row 2" = index 1, "column 1" = index 0. So the access is table[1][0]. Even though rows can have different lengths, the indexing syntax stays the same as regular 2D arrays — only the allocation differs.

Q30. Why does C not support native jagged arrays like some other languages do?

  • a) Because C arrays are fixed-size at compile time
  • b) Because C 2D arrays require all rows to have the same length
  • c) Because C uses flat contiguous memory for arrays
  • d) All of the above reasons combine

Answer: d) All of the above reasons combine

A real 2D array in C is one flat block of memory with a fixed stride between rows. If rows had different lengths, indexing math (base + row × width + col) wouldn't work. That's why C programmers simulate jagged arrays using arrays of pointers instead — each row is allocated separately, and each pointer can point to a different-sized block.

Arrays and Functions

Q31. What is the correct way to pass an array to a function in C?

  • a) Passing the array name
  • b) Passing each element individually
  • c) Passing only the array size
  • d) Arrays cannot be passed to functions in C

Answer: a) Passing the array name

When you pass an array name to a function, it decays to a pointer to its first element. The function receives the address, not a copy — so changes made inside the function affect the original array. Option b) is possible but rarely what you want. Option d) is completely false: arrays are passed all the time.

Q32. How do you pass a 2D array to a function in C?

  • a) Pass the array name; the function parameter must declare all dimensions except the first
  • b) Pass the array name; the function parameter must declare only the first dimension
  • c) Convert the 2D array to a single int before passing
  • d) 2D arrays cannot be passed to functions in C

Answer: a) Pass the array name; the function parameter must declare all dimensions except the first

For a 2D array int m[3][4], the function signature must include the column size: void f(int m[][4]) or void f(int m[3][4]). The row dimension can be omitted because the compiler needs only the column count to compute the stride between rows. This is a subtle point that trips up many beginners — the compiler must know the width of each row.

Q33. What does "array decay" mean in C?

  • a) Arrays are always passed by value
  • b) Array elements lose their values when passed to functions
  • c) An array name becomes a pointer to its first element when passed to a function
  • d) Arrays automatically shrink when passed to functions

Answer: c) An array name becomes a pointer to its first element when passed to a function

This is one of the most important C concepts. When you call a function with an array argument, the array "decays" into a pointer to its first element. Inside the function, sizeof(arr) gives the pointer size (e.g., 8), not the array size. That's why you often pass the length as a separate parameter — the function has no way to know the original array size on its own.

Common Pitfalls

Q34. What is the largest valid index of the array int arr[10];?

  • a) 9
  • b) 10
  • c) 11
  • d) Depends on the compiler

Answer: a) 9

Zero-based indexing means the 10-element array has indices 0 through 9. Accessing arr[10] is out of bounds — undefined behaviour, not a compilation error. This is a very common exam question and a very common source of real-world bugs in C programs.

Q35. What is the risk of using arr[i] where i is out of bounds?

  • a) Compilation error always
  • b) The compiler catches it at runtime
  • c) Undefined behaviour: may crash, read garbage, or corrupt data
  • d) C automatically bounds-checks array access

Answer: c) Undefined behaviour: may crash, read garbage, or corrupt data

C does not perform bounds checking. Accessing arr[i] with an i outside the valid range reads or writes whatever happens to be in that memory. It might crash (segmentation fault), return garbage, corrupt adjacent data, or even seem to work — the behaviour is unpredictable. This is a well-known source of security vulnerabilities like buffer overflows.

Q36. Which of the following is NOT true about arrays in C?

  • a) Arrays can store elements of different data types
  • b) Arrays are passed to functions as pointers (via decay)
  • c) Array elements are stored in contiguous memory
  • d) Static arrays cannot be resized at runtime

Answer: a) Arrays can store elements of different data types

Arrays are homogeneous — all elements must be of the same type. The other three statements (b, c, d) are all true statements about C arrays. This is a classic "which is NOT true" question style — read carefully, because it asks for the false statement, not the true one.

Q37. What will happen if you use arr[5] where arr was declared as int arr[5];?

  • a) It returns the last element, 0
  • b) It returns the first element
  • c) It reads memory outside the array — undefined behaviour
  • d) The compiler refuses to compile the code

Answer: c) It reads memory outside the array — undefined behaviour

Valid indices are 0 through 4. Index 5 is one byte past the array, and C happily reads it — whatever value is there. This is the same off-by-one bug that plagues C programs everywhere. In a debug build with tools like AddressSanitizer, it would be caught; without them, it may silently cause havoc. Always double-check array bounds in your loops.

Q38. Which loop type is most idiomatic for iterating over an array in C?

  • a) while loop
  • b) do-while loop
  • c) for loop with index from 0 to n-1
  • d) goto

Answer: c) for loop with index from 0 to n-1

The classic pattern is for (int i = 0; i < n; i++) { arr[i]; } — clean, concise, and directly matches the array's zero-based indices. While loops work too, but the for loop keeps the counter's lifecycle contained. This is one of the fundamental C idioms every programmer learns early.

Q39. What is the output of the following code?

int arr[3] = {10, 20, 30};
int* p = arr;
printf("%d", *(p + 2));
  • a) 10
  • b) 20
  • c) 30
  • d) Compilation error

Answer: c) 30

The array name arr decays to a pointer to its first element, so p points to arr[0] = 10. Pointer arithmetic p + 2 moves the pointer by two elements (not bytes) to arr[2]. Dereferencing with * gives 30. This is exactly why arr[i] and *(arr + i) mean the same thing — the connection between arrays and pointers in C.

Q40. What does sizeof(arr) / sizeof(arr[0]) compute for int arr[7]?

  • a) 4
  • b) 7
  • c) 28
  • d) 0

Answer: b) 7

sizeof(arr) = 7 × 4 = 28 bytes total, and sizeof(arr[0]) = 4 bytes per element. 28 / 4 = 7, which is the number of elements. This idiom is the standard way to compute an array's length in C and appears in virtually every array tutorial. Remember it breaks if arr is passed to a function (where it has already decayed to a pointer).

Frequently Asked Questions

Why does array indexing start at 0 in C, not 1?

Because arr[i] is shorthand for *(arr + i). The first element lives at arr + 0, so its index is 0. This pointer-arithmetic origin is why C arrays are zero-indexed — and it's a rule shared by almost every modern language (Python, Java, JavaScript, C++, Go).

What is the difference between an array and a pointer in C?

An array is a fixed-size block of memory; its name decays to a pointer when passed to functions. A pointer is a variable holding an address, which can be reassigned. sizeof(arr) gives the total array size; sizeof(ptr) gives the pointer size (usually 8 on 64-bit systems). Arrays cannot be reassigned, but pointers can.

Can I resize an array in C after declaration?

Not if it's a static array — those have fixed size at compile time. For runtime resizing, use dynamic memory (malloc, realloc). C99 also added variable-length arrays (VLAs), but those are still fixed once allocated; they just let the size be determined at runtime rather than compile time.

Why does sizeof(array) give different results than sizeof(*array)?

sizeof(array) returns the total bytes of the entire array (n × element size). sizeof(*array) returns the size of the first element, because *array is the value at index 0, not the array itself. This is a common trap — beginners sometimes think *array means "the whole array", but it means "the first element."

Why is accessing out-of-bounds elements of an array dangerous in C?

C does not perform bounds checking. Accessing arr[n] on an array of size n reads or writes memory outside the array, causing undefined behaviour. It may crash, silently corrupt data, or appear to work in some builds. This is a well-known source of security vulnerabilities like buffer overflows, and why tools like AddressSanitizer and Valgrind exist.

💡 Tip: Arrays are the foundation of most C programs — from strings to structures to dynamic memory. Master the zero-indexing rule and the "array decays to pointer" concept early, because they appear in almost every subsequent C topic. When in doubt, trace indices on paper.

📖 Related MCQ Pages

  • Introduction to C MCQ
  • Operators MCQ
  • Conditional Statements MCQ
  • Loops MCQ
  • Functions MCQ
  • Structures MCQ
  • Pointers MCQ
  • Files MCQ
  • Storage Classes MCQ
  • Dynamic Memory MCQ

Previous Topic: -->> Loops MCQ   ||   Next topic: -->> Functions MCQ


C Language

  • Home
  • Why C Language
  • History of C Language
  • Applications of C Language
  • Introduction To C
    • What is Program?
    • Structure of C Program
    • Working Of C Program
    • CHARACTER SET
    • VARIABLES AND IDENTIFIERS
    • BUILT-IN DATA TYPES
    • OPERATORS AND EXPRESSIONS
    • CONSTANTS AND LITERALS
    • SIMPLE ASSIGNMENT STATEMENT
    • BASIC INPUT/OUTPUT STATEMENT
    • SIMPLE 'C' PROGRAMS
    • Assignments
  • Operators in C Programming
    • Arithmetic Operators
    • Assignment Operators
    • Increment and Decrement Operators
    • Relational Operators
    • Logical Operators
    • Bitwise Operators
    • Other Operators
    • Assignments
  • Conditional Statements
    • DECISION MAKING WITHIN A PROGRAM
    • CONDITIONS
    • IF STATEMENT
    • IF-ELSE STATEMENT
    • IF-ELSE LADDER
    • NESTED IF-ELSE
    • SWITCH CASE
    • Assignments
  • Loops Statements
    • Introduction to Loops
    • GO TO Statement
    • Do while Loop
    • While Loop
    • Nested While Loop
    • Difference Between While and Do while
    • Difference Between Goto and loop
    • while loop assignments
    • C FOR Loop
    • C For loop examples
    • Nested for loop
    • Nested for loop examples
    • Infinite while Loops
    • Infinite for Loops
    • Continue in Loops
    • break in Loops
    • difference while do..while & for
    • Assignments
  • Arrays
    • One Dimensional Array
    • Declaring 1D Arrays
    • Initilization of 1D arrays
    • Accessing element of one 1D Array
    • Read and Display 1D Arrays
    • Two Dimensional Arrays
    • Declare 2D Arrays
    • Read and Display 2D Arrays
    • Assignments/Examples
  • Functions
    • Introduction
    • Need For User-Defined Function
    • Multiple Function Program
    • Modular Programming
    • Elements Of User Defined Function
    • Function Definition
    • Function Declaration
    • Types of functions
    • Nesting of Function
    • Recursion
    • Passing Array To Functions
    • Scope,Visibility and Lifetime of Variables
    • Assignments
  • Structure
    • Introduction
    • Array vs Structure
    • Defining Structure
    • Declaring Structure Variables
    • Type Defined Structure
    • Accessing Structure Members
    • Structure Initilization
    • Copying & Comparing Structure Variables
    • Array of Structure
    • Arrays Within Structure
    • Structures Within Structures
    • Structures and Functions
    • Structure Examples/Assignments
  • Union
    • Define Union
    • Create and use Union
    • Difference Between Structure and Union
    • Union Examples
    • Union FAQ
  • Pointers
    • What Are Pointers In C?
    • How Do We Use Pointers In C?
    • Declaration Of A Pointer
    • The Initialization Of A Pointer
    • Syntax Of Pointer Initialization
    • Use Of Pointers In C
    • The Pointer To An Array
    • The Pointer To A Function
    • The Pointer To A Structure
    • Types Of Pointers
    • The Null Pointer
    • The Void Pointer
    • The Wild Pointer
    • The Near Pointer
    • The Huge Pointer
    • The far Pointer
    • dangling pointer
    • Accessing Pointers- Indirectly And Directly
    • Pros Of Using Pointers In C
    • Cons Of Pointers In C
    • Applications Of Pointers In C
    • The & Address Of Operator In C
    • How To Read The Complex Pointers In C?
    • Practice Problems On Pointers
  • File Processing
    • File Handling In C
    • Types Of Files In C
    • Operations Done In File Handling
    • File Examples
    • Binary Files
    • count words,lines in a file
    • Copy files
    • Update File
    • count vowels in a file
  • Preprocessor
    • Macro substitution division
    • File Inclusion
    • Conditional Compilation
    • Other directives
    • Examples
  • Dynamic Memory Allocation
    • malloc
    • calloc
    • free
    • realloc
    • Examples
  • Storage Classes
  • Graphics
  • Frequently Asked Interview Questions (FAQ)
    • Introduction To C FAQ
    • Operators FAQ
    • Conditional Statements FAQ
    • Loops FAQ
    • Arrays FAQ
    • Function FAQ
    • Structure FAQ
    • Pointers FAQ
    • Files FAQ
    • Storage classes FAQ
    • Dynamic Memory FAQ
  • Programs/Assignments
    • Introduction To C
    • Operators
    • Conditional Statements
    • Loops
    • Arrays
    • Function
    • Structure
    • Pointers
    • Files
    • Storage classes
    • Dynamic Memory
  • Case Studies
  • Multiple Choice Questions
    • Introduction To C MCQ
    • Operators MCQ
    • Conditional Statements MCQ
    • Loops MCQ
    • Arrays MCQ
    • Function MCQ
    • Structure MCQ
    • Pointers MCQ
    • Files MCQ
    • Storage classes MCQ
    • Dynamic Memory MCQ
    • More MCQ

Get in touch

  • tech2dsm@gmail.com

© Sankalan Data Tech. All rights reserved.