22. If an array is declared with the statements const int DD- 5 ; and the last e
ID: 3736271 • Letter: 2
Question
22. If an array is declared with the statements const int DD- 5 ; and the last element in the array is_ a. 0 b. 4 23. The structure often used to sequence through an array is the a. do loop b. do while loop for loop linked list 24. A C-string is terminated with a. the newline character b.) the null character c. d. a square bracket a semicolon 25. When passing an array to a called function, the function receives array. the first element of the access to the actual a. a copy of the b. selected elements of the 26. Write a function to calculate the sum of following series where n is input by user. Call this function from main() and output your result in main(). n13 t 1/4 + 1/5...-/nExplanation / Answer
22. Its wrong. c) 4 is the right answer. This is because, value of DD is 5, and size of Arr is DD. So size of Arr is 5. But index of Array starts from 0 not 1. So all indexes are 0,1,2,3,4 and last index is 4.
23. c) for loop is correct. as using for loop we initialize indexes and using those indexes we traverse the array.
24. b) null character is correct. A C string terminates with '' character which is also called null character.
25. d) is wrong here. Correct option is c) first element of the array. This is because when we pass an entire array to the function eg arr, then it is equivalent to passing address of first element of array i.e. &arr[0] . So correct option is c
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.