Using the following function prototype which statement about the argument passed
ID: 3843156 • Letter: U
Question
Explanation / Answer
28. Option C is true, we cannot make changes to parameters that has been passed as constant (const is keyword for constant).
29. Option A will be the answer because using cin>>sentence, a character array reads input upto a newline or whitespace. It uses whitespace as end of input.
30. False. We need to repeat Newton-Raphson method again and again until we get the root of the equation, we can not figure out exactly how many iterations needed prior to solving.
31. True.
32. Option D. We have to guess many times to get a single root.
33. The statement is False because C++ does not check for array upper bounds.
34. True. It will print the whole text i.e., "Breath Deeply" because C++ will copy the whole string in the character array sentence.
35. Option D i.e., 10 because array index starts from 0. myArray[1][2] means data stored in second row and third column.
BLUE BOOK:
I.
Program execution steps:
If N < 10 i.e., 2 < 10 then iterate again.
If N < 10 i.e., -1 < 10 then iterate again.
If N < 10 i.e., 10 < 10 which is false, so exit loop.
4. B = B * 2 = 10 * 2 = 20
5. Displaying Output: (N,A,B) = (10,42,20)
Note: cout<< is used to display data.
6. returning 0 and exiting function.
II.
From the loops, we can say that the array has 4 rows and 2 columns because L is iterating from 3 to 1 and array has indices starting from 0 and L has been used as the row index and M is iterating 2 times from 0 to 1 and M has been used as the column index.
Suppose Array B is like:
Output:
6 5
9 81
4 7
Iteration 1 Read N = 5 A = A + N + B = 3 + 5 + 6 = 14 B = B + 1 = 6 + 1 = 7 If N < 10 i.e., 5 < 10 then iterate again.Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.