Question
Consider the following code snippet. What is the output
of the program? #include < stdio.h > int main ( ) {   int arr[5] = {1, 2, 3, 4, 5};   int *ptr = arr;   ptr + = 2;   printf("%d", *ptr);   return 0; }Solution
In the code, ptr initially points to the first element of the array arr. The line ptr += 2; moves the pointer two positions ahead, meaning ptr now points to the third element of the array, which is 3. Therefore, *ptr dereferences the pointer to print the value 3. Why Other Options are Wrong: a) 1 is the first element, but the pointer has moved past it. b) 2 is the second element, but ptr skips over it. d) 4 is the fourth element, but ptr stops at the third. e) 5 is the fifth element, beyond where ptr is pointing.
Why did the RBI defer the rollout of the Liquidity Coverage Ratio (LCR) norms by a year?
The Rashtriya Gokul Mission, which has played a vital role in increasing India's milk production, contributed to an increase in milk production by what ...
The new Income Tax (No. 2) Bill, 2025 replaces which previous legislation?Â
Why is July 22 observed as National Flag Day in India?Â
Who was crowned Miss Universe India 2025?Â
Which Indian state is introducing a new policy to boost film and television production in 2025?
- What was India's Current Account Deficit (CAD) as a percentage of GDP in Q3 FY25?
What amount did Federal Bank raise through its inaugural issuance of long-term infrastructure bonds?
What major challenge was highlighted in the S&P Global Mobility survey regarding Indian cities?Â
- Who won the Best Actress Award at the 2025 BAFTA Awards?