What is the name of loop variable, or loop control variable? How many iterations does the loop do? What is initial value of count?

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

please answer all questions about for loop below:

for (i = 1; i <= 5; i++)

 {

  cout << i << “,  ”<<endl;

 }

 

Questions:

  1. What is the name of loop variable, or loop control variable?
  2. How many iterations does the loop do?
  3. What is initial value of count?
  4. What is value of i when the loop exits (fails)
  5. What is the output of the code?
  6. What is increment in i between each iteration
  7. Observe comma in cout
  8. When is the variable incremented: Beginning or the end
  9. Loop variable must be defined before entering loop
  10. This is pretest loop

The integer counter, i, controls the number of loop iterations

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning