<<< An "Endless" Loop Example | Index | Logical (Boolean) Operators >>> |
A loop that calculates the sum of the numbers 1 through 4
int idx = 1; int sum = 0; while( idx < 5 ) { sum = sum + idx; idx = idx + 1; }
<<< An "Endless" Loop Example | Index | Logical (Boolean) Operators >>> |