190k views
2 votes
To create a loop that executes exactly b times, we create a ______

1 Answer

2 votes

Final answer:

To create a loop that executes exactly b times, we create a for loop.

Step-by-step explanation:

To create a loop that executes exactly b times, we create a for loop. In a for loop, we can specify the number of times the loop should execute by setting the loop's condition to i < b, where i is the loop variable. Here's an example:

for (int i = 0; i < b; i++) {
// code to be executed
}

In this example, the loop will execute exactly b times, as long as the condition i < b is true.

User Ashish Sahu
by
8.2k points

No related questions found