Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

5. A special value that marks the end ofa list of input data is called a a. term

ID: 3842127 • Letter: 5

Question

5. A special value that marks the end ofa list of input data is called a a. terminal value b. sentinel value c. loop control value d. input value e. loop termination value 6. The effect of the following program segment can best be described as if (x y) if (x y) z 0; if (x y) a. The smaller of x and y is stored in z b The larger of x and y is stored in z c. The larger of x and y is stored in z unless x and y are equat, in which case zis assigned zero d. The larger of x and y is stored in z unless x and y are not equal, in which case z is assigned zero. e. none of the above What will be the value ofi after the C statements at the right have been executed? j- 10 if (3 i) j) i- i 2 d. 10 i i t- 3; e.. 15

Explanation / Answer

5. b sentinel value

6. d. The larger of x and y is stored in z unless x and y are not equal , in which case z is assigned 0.

7. c 8

First the i value is 3 and j is 10. So in the if condition 9<10. So i will be incremented as i+2, then the i value is 5. Now if condition 15>10 so it comes out from the loop. Then again i value will be incremented as i+3, then finally i value will be 5+3 i.e. 8.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote