Question
What is the output of the following C code? int a[] = {1, 2, 3, 4, 5}; int *p = &a[4]; int *q = &a[1]; printf("%d %d", (int)(p -
What is the output of the following C code? int a[] = {1, 2, 3, 4, 5}; int *p = &a[4]; int *q = &a[1]; printf("%d %d", (int)(p -
q), *(q + 2));
More C Programming Questions
- What is a key difference between the malloc() and calloc() functions in C?
- What is the output of the following C code?
- What is the output of the following C code? struct Point { int x, y; }; struct Point p1 = {3,4}; struct Point *ptr = &p1; ptr->x += ptr->y; ptr->y = p...
- What is the output of the following C code? int arr[3][3] = {{1,2,3},{4,5,6},{7,8,9}}; printf("%d", *(*(arr+2)+1));
- Which algorithm is used to find the shortest path from a single source in graphs with negative weights?
- What is the output of the following C code? int arr[3][4] = {{1,2,3,4},{5,6,7,8},{9,10,11,12}}; printf("%d", *(*(arr+1)+2));
- What is the output of the following C code? int a = 12, b = 25; printf("%d", (a & b) | (a ^ b));
- What is the output of the following C code? int x = 5, y = 2; printf("%d", x++ / y + x % y);
- Which C++ keyword, when applied to a base class member function, enables runtime polymorphism by allowing that function to be overridden and correctly disp...
- ch data structure is used in Depth-First Search (DFS)?
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)