To repeatedly execute logic, one can use loops. One of the most common loop types in C# is the while
loop, which keeps on looping until a Boolean condition evaluates to false
.
int x = 23;
while (x > 10)
{
// Execute logic if x > 10
x = x - 1;
}