- #1
amaresh92
- 163
- 0
greetings,
what is the meaning of controlled loop and count controlled loop?
advanced thanks.
what is the meaning of controlled loop and count controlled loop?
advanced thanks.
while (1)
{
// do something
}
while (response != 'Y' && response != 'y')
{
printf("Do you want to continue?");
response = getch();
}
i = 0;
while (i < 5)
{
printf("%d\n", i);
i++;
}
A controlled loop is a programming structure that repeats a set of instructions for a specified number of times or until a certain condition is met. It allows for efficient and organized execution of code.
A count controlled loop is a type of controlled loop where the number of iterations is predetermined and known before the loop begins. A control controlled loop, on the other hand, is a type of controlled loop where the loop continues until a certain condition is met.
To create a controlled loop in programming, you need to use a loop statement such as for loop, while loop, or do-while loop. These statements allow for the repetition of a set of instructions based on a specified condition.
Controlled loops allow for efficient execution of code by eliminating the need for repetitive code. They also make it easier to manage and organize code, and can help prevent errors and bugs.
Yes, controlled loops can be nested, meaning one controlled loop can be placed inside another. This allows for more complex and detailed iterations and gives programmers more control over their code.