What is an infinite Loop? How infinite loop is declared?

DWQA QuestionsCategory: JavaWhat is an infinite Loop? How infinite loop is declared?
Editor Staff asked 1 month ago

What is an infinite Loop? How infinite loop is declared?

1 Answers
Editor Staff answered 1 month ago

An infinite loop runs without any condition and runs infinitely. An infinite loop can be broken by defining any breaking logic in the body of the statement blocks.
Infinite loop is declared as follows:
for (;;)
{
// Statements to execute
// Add any loop breaking logic
}