Syntax: while (condition) { /* code */ }
while (condition) { /* code */ }
Avoid conditions that are always true, e.g., while(true) without a break.
while(true)
Use while loops when the number of iterations is not known in advance.