What will be the values stored in the array after the following code in C? #include <stdio.h> int main() { int a[5] = {1, 2}; for (int i = 0; i < 5; i++) {printf("a[%d] = %d", i, a[i]); } return 0; }
Asked in GPSC Deputy Director (IT), Class-1 2025
Answer under review: our editors are checking this question. Try the other GPSC Prelims previous year questions questions meanwhile.
More GPSC Prelims previous year questions questions
- Why is a base condition necessary in recursion?
- What is the time complexity to search an element in a singly linked list?
- What will you get if you do an inorder traversal of a Binary Search Tree (BST)?
- How is a graph usually represented using an adjacency list?
- If A = {1, 2} and B = {x, y}, then which one is the correct option for A × B (Cartesian product)?
- What is the chromatic number of a graph?
- Which of the following properties must a relation satisfy to be considered as a partial order?
- A lattice is a partially ordered set in which every pair of elements has