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.
The vice principal decided to resign when he was passed over for promotion to principal.
The onset off the Second World War (A)/ showed that the League (B)/ has failed its primary purpose,(C)/ which was prevent (D)/ any future world war (E)....
1. Thailand and Nigeria are pioneers in Scrabble and have recognized it as a sport, which countries like India should also consider exploring for the be...
India were ranked 110 (A)/ in terms of personal freedom (B)/ and 105 on economic freedom (C)/ with a overall score of 6.43 out of 10 (D).
The tangible (A) slowdown in exports, due to weaker (B) global demand, is unlikely to expected (C) much soon, with recessions or sharp growth slowdowns ...
RECTITUDE
Select the option that expresses the given sentence in reported speech.
" Don't forget to bring your umbrella," he said to his brother.
...Identify the segment in the sentence which contains a grammatical error.
The various aims of each government is, undoubtedly, reasonable but th...
The ministry has directed all engineering colleges in India, (A)/ the ones that figures in the National Institutional Ranking Framework rating, (B)/ to ...
I was surprised to see as Avika could write such good poems in Hindi.