Skip to content
ExamHope Logo

examhope

Primary Menu
  • Digital Logic
    • Arithmetic Operations
    • Asynchronous/Ripple Counters
    • Basic Gates
    • Boolean Algebraic Theorems
    • Codes
  • Data Structures
    • Binary Heaps
    • Binary Search
    • Binary Search Trees
    • Binary Tree
    • Binary Tree Sort
    • Bipartite Graphs
    • Complete Graph
  • Theory of Computation
    • Finite Automata
    • Finite Automaton First Example
  • Current Affairs
    • Sports News
    • Tech News
    • Bollywood News
    • Daily News
  • Database
  • Computer Network
  • Computer Organization and Architecture
  • C Language
  • Operating Systems
  • Software Engineering
  • Theory of Computation
  • About us
  • Contact Us
  • Privacy Policy
  • DMCA Policy
  • Terms and Conditions
  • Home
  • IT
  • Arrays MCQs in C Language
  • IT
  • Arrays
  • C Language

Arrays MCQs in C Language

examhopeinfo@gmail.com October 24, 2025 15 minutes read
Arrays MCQs in C Language

Arrays MCQs in C Language

Arrays MCQs in C Language


1.

What is the output of:

#include <stdio.h>
int main() {
    int arr[5] = {1, 2, 3, 4, 5};
    printf("%d", arr[2]);
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: C
Explanation:
arr[2] refers to the 3rd element (0-based indexing) โ†’ 3.


2.

What is the index of the last element in an array of size 10?

A) 10
B) 9
C) 0
D) 1

โœ… Answer: B
Explanation:
Arrays are 0-indexed โ†’ last index = size-1 = 9.


3.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {5};
    printf("%d %d %d", arr[0], arr[1], arr[2]);
}

A) 5 5 5
B) 5 0 0
C) 0 0 0
D) Compiler error

โœ… Answer: B
Explanation:
First element initialized to 5, rest automatically 0 โ†’ 5 0 0.


4.

Which of the following is invalid in C?

A) int arr[5];
B) int arr[] = {1,2,3};
C) int arr[2] = {1,2,3};
D) int arr[3] = {0};

โœ… Answer: C
Explanation:
Array size is 2 but 3 elements initialized โ†’ invalid.


5.

What is the output?

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%u", arr);
}

A) Address of arr[0]
B) Value 1
C) Value 0
D) Compiler error

โœ… Answer: A
Explanation:
arr as an expression decays to pointer to first element โ†’ prints address of arr[0].


6.

Which is valid declaration of 2D array?

A) int arr[3,4];
B) int arr[3][4];
C) int arr(3)(4);
D) int arr[3][4][5];

โœ… Answer: B
Explanation:
2D array syntax โ†’ rows ร— columns โ†’ int arr[3][4]; valid.


7.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    printf("%d", arr[1][0]);
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: C
Explanation:
arr[1][0] โ†’ second row, first column โ†’ 3.


8.

Which statement is true about arrays?

A) Array size can be changed at runtime
B) Array name is a constant pointer
C) Arrays can store different types
D) Arrays can have negative index

โœ… Answer: B
Explanation:
Array name represents address of first element, acts like constant pointer.


9.

Output:

#include <stdio.h>
int main() {
    int arr[5] = {1,2,3,4,5};
    printf("%d", *(arr+3));
}

A) 3
B) 4
C) 5
D) Compiler error

โœ… Answer: B
Explanation:
Pointer arithmetic โ†’ arr+3 points to 4th element โ†’ 4.


10.

What is the correct way to pass an array to a function?

A) void fun(int arr[])
B) void fun(int arr[10])
C) void fun(int *arr)
D) All of the above

โœ… Answer: D
Explanation:
All three syntaxes are valid โ†’ array decays to pointer when passed.


11.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {10, 20, 30};
    printf("%d", arr[5]);
}

A) 0
B) 30
C) Garbage value
D) Compiler error

โœ… Answer: C
Explanation:
Accessing out-of-bounds โ†’ undefined behavior โ†’ garbage.


12.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    int *p = arr;
    printf("%d", *(p+2));
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: C
Explanation:
Pointer arithmetic โ†’ *(p+2) points to 3rd element โ†’ 3.


13.

Which of the following is not allowed?

A) arr[0] = 5;
B) *(arr+1) = 10;
C) arr++;
D) printf("%d", arr[2]);

โœ… Answer: C
Explanation:
Array name is constant pointer โ†’ cannot increment โ†’ arr++ invalid.


14.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1};
    printf("%d %d %d", arr[0], arr[1], arr[2]);
}

A) 1 1 1
B) 1 0 0
C) 1 2 3
D) Compiler error

โœ… Answer: B
Explanation:
Only first element initialized โ†’ rest zero โ†’ 1 0 0.


15.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    int (*p)[3] = arr;
    printf("%d", *(*(p+1)+2));
}

A) 3
B) 4
C) 6
D) 5

โœ… Answer: C
Explanation:
p+1 โ†’ second row, +2 โ†’ third column โ†’ 6.


16.

What is the output?

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%u", arr+1-arr);
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: A
Explanation:
Pointer arithmetic โ†’ difference in elements โ†’ 1.


17.

Which statement is correct for a 2D array declaration?

A) int arr[2][];
B) int arr[][3];
C) int arr[][];
D) int arr[3,3];

โœ… Answer: B
Explanation:
Column size must be specified โ†’ valid: int arr[][3];.


18.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {5,10,15};
    int *p = &arr[0];
    printf("%d", *(p+1));
}

A) 5
B) 10
C) 15
D) Compiler error

โœ… Answer: B
Explanation:
Pointer arithmetic โ†’ *(p+1) โ†’ second element โ†’ 10.


19.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    int *p = &arr[0][0];
    printf("%d", *(p+3));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: D
Explanation:
Array stored row-wise โ†’ p+3 โ†’ 4th element โ†’ 4.


20.

Which of the following is correct for initializing an array partially?

A) int arr[5] = {1,2};
B) int arr[5] = {1,2,3,4,5,6};
C) int arr[5] = {};
D) int arr[] = {1,2,3,4,5,6};

โœ… Answer: A
Explanation:
Partial initialization allowed โ†’ remaining elements set to 0.

21.

Output:

#include <stdio.h>
int main() {
    int arr[4] = {1,2};
    printf("%d %d %d %d", arr[0], arr[1], arr[2], arr[3]);
}

A) 1 2 0 0
B) 1 2 3 4
C) 0 0 0 0
D) Compiler error

โœ… Answer: A
Explanation:
Partial initialization โ†’ arr[0]=1, arr[1]=2, arr[2]=0, arr[3]=0.


22.

What is the size in bytes of int arr[10]; on a system where int=4 bytes?

A) 10 bytes
B) 40 bytes
C) 4 bytes
D) 14 bytes

โœ… Answer: B
Explanation:
Size = 10 ร— 4 = 40 bytes.


23.

Output:

#include <stdio.h>
int main() {
    int arr[3][2] = {{1,2},{3,4},{5,6}};
    printf("%d", arr[2][1]);
}

A) 4
B) 5
C) 6
D) 3

โœ… Answer: C
Explanation:
arr[2][1] โ†’ third row, second column โ†’ 6.


24.

Which of the following is invalid?

A) int arr[3];
B) int arr[3] = {1,2,3};
C) int arr[] = {1,2,3,4,5};
D) int arr[2] = {1,2,3};

โœ… Answer: D
Explanation:
Array size = 2 but initialized with 3 elements โ†’ invalid.


25.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%d", *(arr+1));
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: B
Explanation:
Pointer arithmetic โ†’ *(arr+1) โ†’ second element โ†’ 2.


26.

Which declaration is correct for a 3ร—4 2D array?

A) int arr[3,4];
B) int arr[3][4];
C) int arr(3)(4);
D) int arr[4][3];

โœ… Answer: B
Explanation:
2D array โ†’ rows ร— columns โ†’ int arr[3][4].


27.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    int *p = &arr[0][0];
    printf("%d", *(p+4));
}

A) 4
B) 5
C) 6
D) Compiler error

โœ… Answer: B
Explanation:
Row-major storage โ†’ *(p+4) โ†’ 5th element โ†’ 5.


28.

Which of the following is true about array names?

A) Can be incremented
B) Constant pointer to first element
C) Can point to different memory
D) Can be assigned to another array

โœ… Answer: B
Explanation:
Array name represents address of first element, acts as constant pointer.


29.

Output:

#include <stdio.h>
int main() {
    int arr[5] = {1,2,3,4,5};
    printf("%d", arr[5]);
}

A) 0
B) 5
C) Garbage value
D) Compiler error

โœ… Answer: C
Explanation:
Out-of-bounds access โ†’ undefined behavior โ†’ garbage value.


30.

Correct way to pass an array to a function?

A) void fun(int arr[])
B) void fun(int arr[10])
C) void fun(int *arr)
D) All of the above

โœ… Answer: D
Explanation:
All three syntaxes are valid โ†’ array decays to pointer when passed.


31.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1};
    printf("%d %d %d", arr[0], arr[1], arr[2]);
}

A) 1 1 1
B) 1 0 0
C) 0 0 0
D) Compiler error

โœ… Answer: B
Explanation:
Partial initialization โ†’ first element 1, rest 0.


32.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    int *p = arr;
    printf("%d", *(p+2));
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: C
Explanation:
Pointer arithmetic โ†’ *(p+2) โ†’ third element โ†’ 3.


33.

Which statement is invalid?

A) arr[0] = 5;
B) *(arr+1) = 10;
C) arr++;
D) printf("%d", arr[2]);

โœ… Answer: C
Explanation:
Array name is constant pointer, cannot increment โ†’ arr++ invalid.


34.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,0,0};
    printf("%d %d %d", arr[0], arr[1], arr[2]);
}

A) 1 1 1
B) 1 0 0
C) 0 0 0
D) Compiler error

โœ… Answer: B
Explanation:
Initialized elements โ†’ printed as 1 0 0.


35.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    int (*p)[3] = arr;
    printf("%d", *(*(p+1)+2));
}

A) 3
B) 4
C) 6
D) 5

โœ… Answer: C
Explanation:
p+1 โ†’ second row, +2 โ†’ third column โ†’ 6.


36.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%u", arr+1-arr);
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: A
Explanation:
Pointer arithmetic โ†’ difference in elements โ†’ 1.


37.

Valid declaration for 2D array with unknown rows but 3 columns?

A) int arr[][3];
B) int arr[3][];
C) int arr[][];
D) int arr[3,3];

โœ… Answer: A
Explanation:
Column size must be specified โ†’ valid: int arr[][3].


38.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {5,10,15};
    int *p = &arr[0];
    printf("%d", *(p+1));
}

A) 5
B) 10
C) 15
D) Compiler error

โœ… Answer: B
Explanation:
Pointer arithmetic โ†’ *(p+1) โ†’ second element โ†’ 10.


39.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    int *p = &arr[0][0];
    printf("%d", *(p+3));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: D
Explanation:
Row-major storage โ†’ 4th element โ†’ 4.


40.

Valid partial initialization of array?

A) int arr[5] = {1,2};
B) int arr[5] = {1,2,3,4,5,6};
C) int arr[5] = {};
D) int arr[] = {1,2,3,4,5,6};

โœ… Answer: A
Explanation:
Partial initialization โ†’ remaining elements set to 0.

41.

Output:

#include <stdio.h>
int main() {
    int arr[4] = {1,2};
    printf("%d %d %d %d", arr[0], arr[1], arr[2], arr[3]);
}

A) 1 2 0 0
B) 1 2 3 4
C) 0 0 0 0
D) Compiler error

โœ… Answer: A
Explanation:
Partial initialization โ†’ arr[0]=1, arr[1]=2, arr[2]=0, arr[3]=0.


42.

Size in bytes of float arr[10]; on a system where float=4 bytes?

A) 10
B) 40
C) 4
D) 14

โœ… Answer: B
Explanation:
Size = 10 ร— 4 = 40 bytes.


43.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    printf("%d", arr[1][2]);
}

A) 4
B) 5
C) 6
D) Compiler error

โœ… Answer: C
Explanation:
Second row, third column โ†’ arr[1][2] = 6.


44.

Which of the following will cause compilation error?

A) int arr[3] = {1,2,3};
B) int arr[] = {1,2,3};
C) int arr[2] = {1,2,3};
D) int arr[3];

โœ… Answer: C
Explanation:
Array size = 2 but 3 elements โ†’ invalid.


45.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%d", *(arr+2));
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: C
Explanation:
Pointer arithmetic โ†’ *(arr+2) โ†’ third element โ†’ 3.


46.

Which is correct syntax for a 3ร—4 2D array?

A) int arr[3,4];
B) int arr[3][4];
C) int arr(3)(4);
D) int arr[4][3];

โœ… Answer: B
Explanation:
2D array โ†’ rows ร— columns โ†’ int arr[3][4].


47.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    int *p = &arr[0][0];
    printf("%d", *(p+4));
}

A) 4
B) 5
C) 6
D) Compiler error

โœ… Answer: B
Explanation:
Row-major โ†’ 5th element โ†’ 5.


48.

Which statement is true about array names?

A) Can be incremented
B) Constant pointer to first element
C) Can point to different memory
D) Can be assigned to another array

โœ… Answer: B
Explanation:
Array name โ†’ address of first element, constant pointer.


49.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%d", arr[3]);
}

A) 0
B) 3
C) Garbage value
D) Compiler error

โœ… Answer: C
Explanation:
Out-of-bounds โ†’ undefined behavior โ†’ garbage.


50.

Correct way to pass an array to a function?

A) void fun(int arr[])
B) void fun(int arr[10])
C) void fun(int *arr)
D) All of the above

โœ… Answer: D
Explanation:
All three syntaxes valid โ†’ array decays to pointer.


51.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1};
    printf("%d %d %d", arr[0], arr[1], arr[2]);
}

A) 1 1 1
B) 1 0 0
C) 0 0 0
D) Compiler error

โœ… Answer: B
Explanation:
Partial initialization โ†’ arr[0]=1, others 0 โ†’ 1 0 0.


52.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    int *p = arr;
    printf("%d", *(p+2));
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: C
Explanation:
Pointer arithmetic โ†’ *(p+2) โ†’ third element โ†’ 3.


53.

Which statement is invalid?

A) arr[0] = 5;
B) *(arr+1) = 10;
C) arr++;
D) printf("%d", arr[2]);

โœ… Answer: C
Explanation:
Array name = constant pointer โ†’ cannot increment โ†’ arr++ invalid.


54.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,0,0};
    printf("%d %d %d", arr[0], arr[1], arr[2]);
}

A) 1 1 1
B) 1 0 0
C) 0 0 0
D) Compiler error

โœ… Answer: B
Explanation:
Initialized values โ†’ arr[0]=1, arr[1]=0, arr[2]=0.


55.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    int (*p)[3] = arr;
    printf("%d", *(*(p+1)+2));
}

A) 3
B) 4
C) 6
D) 5

โœ… Answer: C
Explanation:
p+1 โ†’ second row, +2 โ†’ third column โ†’ 6.


56.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%u", arr+1-arr);
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: A
Explanation:
Pointer arithmetic โ†’ difference in elements โ†’ 1.


57.

Valid 2D array declaration with unknown rows but 3 columns?

A) int arr[][3];
B) int arr[3][];
C) int arr[][];
D) int arr[3,3];

โœ… Answer: A
Explanation:
Column size must be specified โ†’ valid: int arr[][3].


58.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {5,10,15};
    int *p = &arr[0];
    printf("%d", *(p+1));
}

A) 5
B) 10
C) 15
D) Compiler error

โœ… Answer: B
Explanation:
Pointer arithmetic โ†’ *(p+1) โ†’ second element โ†’ 10.


59.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    int *p = &arr[0][0];
    printf("%d", *(p+3));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: D
Explanation:
Row-major โ†’ 4th element โ†’ 4.


60.

Valid partial initialization of array?

A) int arr[5] = {1,2};
B) int arr[5] = {1,2,3,4,5,6};
C) int arr[5] = {};
D) int arr[] = {1,2,3,4,5,6};

โœ… Answer: A
Explanation:
Partial initialization allowed โ†’ remaining elements set to 0.

61.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    int *p = arr;
    printf("%d", *(p+0));
}

A) 0
B) 1
C) 2
D) 3

โœ… Answer: B
Explanation:
*(p+0) points to first element โ†’ 1.


62.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%u", &arr[2]-arr);
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: B
Explanation:
Address difference โ†’ 2nd index minus 0th index โ†’ 2.


63.

Output:

#include <stdio.h>
int main() {
    int arr[3][2] = {{1,2},{3,4},{5,6}};
    printf("%d", arr[2][0]);
}

A) 3
B) 4
C) 5
D) 6

โœ… Answer: C
Explanation:
Third row, first column โ†’ arr[2][0] = 5.


64.

Which declaration allocates memory for 5 integers?

A) int arr[5];
B) int arr[] = {1,2,3,4,5};
C) Both A and B
D) None

โœ… Answer: C
Explanation:
Both allocate 5 integers โ†’ valid.


65.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    int *p = &arr[1];
    printf("%d", *(p+1));
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: C
Explanation:
Pointer p points to arr[1]=2 โ†’ *(p+1)=arr[2]=3.


66.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    int (*p)[2] = arr;
    printf("%d", *(*(p+1)+1));
}

A) 2
B) 3
C) 4
D) 1

โœ… Answer: C
Explanation:
p+1 โ†’ second row, +1 โ†’ second column โ†’ 4.


67.

Output:

#include <stdio.h>
int main() {
    int arr[5] = {10,20,30,40,50};
    int *p = arr;
    printf("%d", *(p+4));
}

A) 40
B) 50
C) 30
D) 0

โœ… Answer: B
Explanation:
*(p+4) โ†’ fifth element โ†’ 50.


68.

Which is correct syntax for initializing all elements to 0?

A) int arr[5] = {0};
B) int arr[5] = {1,0};
C) int arr[5];
D) int arr[5] = {};

โœ… Answer: A
Explanation:
First element 0, rest implicitly 0 โ†’ all zero.


69.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    int *p = arr+1;
    printf("%d", *p);
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: B
Explanation:
p = arr+1 โ†’ points to second element โ†’ 2.


70.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    printf("%d", *(*(arr+1)+2));
}

A) 3
B) 4
C) 6
D) 5

โœ… Answer: C
Explanation:
arr+1 โ†’ second row, +2 โ†’ third column โ†’ 6.


71.

Which statement is true about 2D arrays?

A) Stored column-wise
B) Stored row-wise
C) Always contiguous in memory
D) Both B and C

โœ… Answer: D
Explanation:
C arrays stored row-wise and contiguous.


72.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%u", arr);
}

A) 1
B) 2
C) 3
D) Address of arr[0]

โœ… Answer: D
Explanation:
Array name โ†’ pointer to first element โ†’ prints address.


73.

Output:

#include <stdio.h>
int main() {
    int arr[3][2] = {{1,2},{3,4},{5,6}};
    int (*p)[2] = arr;
    printf("%d", *(*(p+2)+0));
}

A) 3
B) 5
C) 6
D) 4

โœ… Answer: B
Explanation:
p+2 โ†’ third row, +0 โ†’ first column โ†’ 5.


74.

Output:

#include <stdio.h>
int main() {
    int arr[4] = {1,2,3,4};
    printf("%d", *(arr+2));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: C
Explanation:
*(arr+2) โ†’ third element โ†’ 3.


75.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1};
    printf("%d %d %d", arr[0], arr[1], arr[2]);
}

A) 1 1 1
B) 1 0 0
C) 0 0 0
D) Compiler error

โœ… Answer: B
Explanation:
Partial initialization โ†’ first element 1, others 0.


76.

Which of the following is invalid?

A) arr[0] = 5;
B) *(arr+1) = 10;
C) arr++;
D) printf("%d", arr[2]);

โœ… Answer: C
Explanation:
Array name = constant pointer โ†’ cannot increment.


77.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    int (*p)[3] = arr;
    printf("%d", *(*(p+1)+0));
}

A) 3
B) 4
C) 5
D) 6

โœ… Answer: B
Explanation:
p+1 โ†’ second row, +0 โ†’ first column โ†’ 4.


78.

Output:

#include <stdio.h>
int main() {
    int arr[5] = {1,2,3,4,5};
    printf("%d", *(arr+4));
}

A) 4
B) 5
C) 3
D) 0

โœ… Answer: B
Explanation:
*(arr+4) โ†’ fifth element โ†’ 5.


79.

Which initializes all elements to zero?

A) int arr[5] = {0};
B) int arr[5];
C) int arr[5] = {1};
D) int arr[5] = {};

โœ… Answer: A
Explanation:
First element 0, rest implicitly 0 โ†’ all zero.


80.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    int *p = &arr[0][0];
    printf("%d", *(p+2));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: C
Explanation:
Row-major โ†’ third element โ†’ 3.

81.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {5,10,15};
    int *p = arr;
    printf("%d", *(p+2));
}

A) 5
B) 10
C) 15
D) Compiler error

โœ… Answer: C
Explanation:
*(p+2) โ†’ third element โ†’ 15.


82.

Which statement is true about arrays?

A) Array size can be changed at runtime
B) Array name is a constant pointer
C) Arrays can store different types
D) Arrays can have negative index

โœ… Answer: B
Explanation:
Array name represents address of first element, acts as constant pointer.


83.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    int (*p)[2] = arr;
    printf("%d", *(*(p+0)+1));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: B
Explanation:
p+0 โ†’ first row, +1 โ†’ second column โ†’ 2.


84.

Which of the following initializes all elements to zero?

A) int arr[5] = {0};
B) int arr[5];
C) int arr[5] = {1,2};
D) int arr[5] = {};

โœ… Answer: A
Explanation:
First element 0, rest implicitly 0 โ†’ all zero.


85.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%u", &arr[0]);
}

A) 1
B) Value of arr[0]
C) Address of arr[0]
D) Compiler error

โœ… Answer: C
Explanation:
&arr[0] โ†’ address of first element โ†’ prints memory address.


86.

Output:

#include <stdio.h>
int main() {
    int arr[2][3] = {{1,2,3},{4,5,6}};
    int *p = &arr[0][0];
    printf("%d", *(p+5));
}

A) 5
B) 6
C) 4
D) Compiler error

โœ… Answer: B
Explanation:
Row-major โ†’ 6th element โ†’ *(p+5) = 6.


87.

Which is invalid in C?

A) arr[0] = 5;
B) *(arr+1) = 10;
C) arr++;
D) printf("%d", arr[2]);

โœ… Answer: C
Explanation:
Array name is constant pointer, cannot increment โ†’ arr++ invalid.


88.

Output:

#include <stdio.h>
int main() {
    int arr[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
    int (*p)[3] = arr;
    printf("%d", *(*(p+2)+2));
}

A) 6
B) 7
C) 8
D) 9

โœ… Answer: D
Explanation:
p+2 โ†’ third row, +2 โ†’ third column โ†’ 9.


89.

Output:

#include <stdio.h>
int main() {
    int arr[4] = {1,2,3,4};
    int *p = arr+1;
    printf("%d", *(p+1));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: C
Explanation:
p = arr+1 โ†’ second element, *(p+1) โ†’ third element โ†’ 3.


90.

Which statement is true for multidimensional arrays?

A) Only first dimension required for declaration
B) Only last dimension required for declaration
C) All dimensions required for declaration
D) Dimensions can be negative

โœ… Answer: B
Explanation:
When declaring an array without initializing, only the last dimension must be specified.


91.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    printf("%d", *(arr+3));
}

A) 0
B) Garbage value
C) 3
D) Compiler error

โœ… Answer: B
Explanation:
Out-of-bounds โ†’ undefined behavior โ†’ garbage value.


92.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    printf("%d", *(*(arr+1)+0));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: C
Explanation:
arr+1 โ†’ second row, +0 โ†’ first column โ†’ 3.


93.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {5,10,15};
    int *p = arr;
    printf("%d", *(p+1));
}

A) 5
B) 10
C) 15
D) Compiler error

โœ… Answer: B
Explanation:
Pointer arithmetic โ†’ *(p+1) โ†’ second element โ†’ 10.


94.

Which initializes first element to 1 and rest to 0?

A) int arr[5] = {1};
B) int arr[5] = {1,0};
C) int arr[5] = {0};
D) int arr[5];

โœ… Answer: A
Explanation:
Partial initialization โ†’ first element 1, others 0.


95.

Output:

#include <stdio.h>
int main() {
    int arr[3][2] = {{1,2},{3,4},{5,6}};
    int (*p)[2] = arr;
    printf("%d", *(*(p+0)+0));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: A
Explanation:
p+0 โ†’ first row, +0 โ†’ first column โ†’ 1.


96.

Output:

#include <stdio.h>
int main() {
    int arr[5] = {1,2,3,4,5};
    printf("%d", arr[4]);
}

A) 4
B) 5
C) 0
D) Compiler error

โœ… Answer: B
Explanation:
arr[4] โ†’ fifth element โ†’ 5.


97.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    int *p = &arr[0][0];
    printf("%d", *(p+1));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: B
Explanation:
Row-major โ†’ second element โ†’ 2.


98.

Output:

#include <stdio.h>
int main() {
    int arr[3] = {1,2,3};
    int *p = arr+2;
    printf("%d", *p);
}

A) 1
B) 2
C) 3
D) Compiler error

โœ… Answer: C
Explanation:
p points to arr[2] โ†’ third element โ†’ 3.


99.

Output:

#include <stdio.h>
int main() {
    int arr[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
    int (*p)[3] = arr;
    printf("%d", *(*(p+1)+1));
}

A) 4
B) 5
C) 6
D) 7

โœ… Answer: B
Explanation:
p+1 โ†’ second row, +1 โ†’ second column โ†’ 5.


100.

Output:

#include <stdio.h>
int main() {
    int arr[2][2] = {{1,2},{3,4}};
    printf("%d", *(*(arr+1)+1));
}

A) 1
B) 2
C) 3
D) 4

โœ… Answer: D
Explanation:
arr+1 โ†’ second row, +1 โ†’ second column โ†’ 4.

About the Author

examhopeinfo@gmail.com

Administrator

Visit Website View All Posts

Post navigation

Previous: Storage Classes MCQs in C Language
Next: Strings MCQs in C Language

Related News

India Squad for Afghanistan Series
  • IT

India Squad for Afghanistan Series Likely to Witness Major Changes, Leadership Reshuffle Possible

examhopeinfo@gmail.com May 19, 2026 0
Brazil Football Team
  • IT
  • Current Affairs
  • Sports News

Brazil Unveils 26-Man Squad for 2026 FIFA World Cup Under Carlo Ancelotti

examhopeinfo@gmail.com May 19, 2026 0
CSK Vs SRH Ipl match
  • IT
  • Current Affairs
  • Sports News

Ruturaj Gaikwad Highlights Squad Challenges After CSKโ€™s Defeat Hurts IPL 2026 Playoff Hopes

examhopeinfo@gmail.com May 19, 2026 0

Recent Posts

  • India Squad for Afghanistan Series Likely to Witness Major Changes, Leadership Reshuffle Possible
  • Brazil Unveils 26-Man Squad for 2026 FIFA World Cup Under Carlo Ancelotti
  • Ruturaj Gaikwad Highlights Squad Challenges After CSKโ€™s Defeat Hurts IPL 2026 Playoff Hopes
  • MS Dhoni Misses CSK Clash Against SRH Due to Fitness Concerns, Ruturaj Gaikwad Shares Update
  • IPL 2026 Playoff Race Heats Up: Rajasthan Royalsโ€™ Defeat to Delhi Capitals Changes Top-4 Battle

At ExamHope, we understand that preparing for exams can be challenging, overwhelming, and sometimes stressful. Thatโ€™s why we are dedicated to providing high-quality educational resources, tips, and guidance to help students and aspirants achieve their goals with confidence. Whether you are preparing for competitive exams, school tests, or professional certifications, ExamHope is here to make your learning journey smarter, easier, and more effective.

Quick links

  • About us
  • Contact Us
  • Privacy Policy
  • Terms and Conditions
  • Disclaimer
  • DMCA Policy

Category

  • Computer Network
  • Computer Organization and Architecture
  • Data Structures
  • C Language
  • Theory of Computation
  • Database

You may have missed

India Squad for Afghanistan Series
  • IT

India Squad for Afghanistan Series Likely to Witness Major Changes, Leadership Reshuffle Possible

examhopeinfo@gmail.com May 19, 2026 0
Brazil Football Team
  • IT
  • Current Affairs
  • Sports News

Brazil Unveils 26-Man Squad for 2026 FIFA World Cup Under Carlo Ancelotti

examhopeinfo@gmail.com May 19, 2026 0
CSK Vs SRH Ipl match
  • IT
  • Current Affairs
  • Sports News

Ruturaj Gaikwad Highlights Squad Challenges After CSKโ€™s Defeat Hurts IPL 2026 Playoff Hopes

examhopeinfo@gmail.com May 19, 2026 0
MS Dhoni News
  • IT
  • Current Affairs
  • Sports News

MS Dhoni Misses CSK Clash Against SRH Due to Fitness Concerns, Ruturaj Gaikwad Shares Update

examhopeinfo@gmail.com May 18, 2026 0
Copyright ยฉ All rights reserved for ExamHope. | MoreNews by AF themes.
Go to mobile version