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.
According to The Companies Act, 2013 ‘Government Company’ means any company in which not less than ________ of the paid-up share capital is held by ...
A factory has direct material cost of ₹2,40,000 and direct labour of ₹1,60,000 for a batch of 1,000 units.
Factory overheads are absorbed at ...
If the fixed cost is Rs.43,500 and the company, the contribution is Rs.500 per unit, how many unit sales would a company need to do to earn a profit of ...
A company purchases machinery for ₹10 lakhs and incurs ₹1 lakh on its installation. The accountant records the total ₹11 lakhs under the fixed ass...
X Ltd. forfeits shares for non-payment of final call. These are reissued at a discount. Where is the discount adjusted?
What does IBNR stand for in insurance?
An assessee is required to deposit how much % of advance tax liability on or before 15th June?
Which form is used to claim ITC in GST returns?
If you want to record all purchase transactions in the accounting software, which shortcut key should you use?
When the total of debit and credit are equal, it represents