Ask Question

The following is an example of what kind of loop?

int x = 0;

while (x < 10)

x=x + 1;

a counter controlled loop

an infinite loop

a sentinel controlled loop

this code will not compile

+3
Answers (2)
  1. 20 May, 15:50
    0
    Step by step equation
  2. 20 May, 15:57
    0
    The answer is "a counter controlled loop".

    Explanation:

    The explanation of the given code as follows:

    An integer variable x is initialized with 0. Using a while loop to check the condition repeatedly. The loop will execute until the value of x is less than 10 and the incrementing value of x variable by one. It is not an infinite loop. The sentinel controlled loop is used when the coder doesn't know the number of iteration to occur in the loop. In other words, we can say that it is opposite to counter controlled loop.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “The following is an example of what kind of loop? int x = 0; while (x < 10) x=x + 1; a counter controlled loop an infinite loop a sentinel ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers