> For the complete documentation index, see [llms.txt](https://abhyas-kanaujia.gitbook.io/lb-dsa-notes-and-homework-abhyas/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://abhyas-kanaujia.gitbook.io/lb-dsa-notes-and-homework-abhyas/03-programming-basics-ii/homework/05.-what-if-condition-is-missing-in-a-loop.md).

# 05. What if condition is missing in a loop?

**While Loop**: If condition is missing in while loop then the compiler will throw an **error** as it **expects** an **expression** inside the parenthesis of the while loop.

```cpp
// Compiler Error: Missing expression before ')'
while()
{
  // code
}
```

**For Loop**: If condition is missing in the for loop then it turns into an infinite loop. The presence of `;;` inside the for loop satisfies the compiler to not make it throw an error.

```cpp
// Infinite Loop
for(;;)
{
  // code
}
```
