Exit Controlled Loop in Java
Below is the implementation of Exit Controlled Loop in Java:
/*package whatever //do not write package name here */
import java.io.*;
class GFG {
public static void main(String[] args)
{
int i = 5;
// Exit Controlled Loop
do {
System.out.println(i);
i--;
} while (i < 5 && i > 0);
}
}
Output
5 4 3 2 1
Exit Controlled Loop in Programming
Exit controlled loops in programming languages allow repetitive execution of a block of code based on a condition that is checked after entering the loop. In this article, we will learn about exit controlled loops, their types, syntax, and usage across various popular programming languages.