Question: can you help me answer the following C programming questions? multiple choice 1. In a while loop, the variable compared in the condition is usually
can you help me answer the following C programming questions?
multiple choice
1. In a while loop, the variable compared in the condition is usually initialized
a. inside the loop at the bottom
b. after the loop
c. inside the loop at the top
d. before the loop
2. How can you make a for loop count downwards rather than upwards?
a. multiply the loop control variable by -1 before using it
b. it cannot be done, you need a while loop
c. set the initial value higher than the ending value and decrement it each time through the loop
d. set the reverse option
3. Spaghetti code occurs when
a. when there is more that one way to exit a loop
b. when there is no way to exit a loop
c. you write your programs in Italy
d. when you place one loop inside another
4. In a do-while loop that is reading data until a special terminating value is read you must include _____ to avoid processing the terminating value.
a. an if that encloses the code for processing the input values
b. another loop that encloses the code for processing the input values
c. a statement to increment the terminating value.
d. a statement to multiply the terminating value by -1.
5. Which are the three parts of the for statement?
a. initialization, increment and body
b. initialization, condition and update
c. start, update, increment
d. begin, end, body
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
