1. Using the operators ++ and --, write statements equivalent to the following statements: sum = sum + 1; sum = sum - 1; 2. Two terms used to describe loop mistakes are “off by one” and “infinite...


1. Using the operators ++ and --, write statements equivalent to the following statements:


sum = sum + 1;


sum = sum - 1;


2. Two terms used to describe loop mistakes are “off by one” and “infinite loop.” Explain the meaning of these terms and write loops that demonstrate each mistake.


3. What is the scope of a variable?


4. What is a sentinel value, and when should one be used?



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here