How about...
for (int n=1; n<5; n++) {
do something
}
.-----.
| Start |
'-----'
|
V
+-------+
| n = 1 |
+-------+
|<---------------------------------------------+
V |
' ' |
/ \ +--------------+ +---------+ |
' n<5? ' --yes--> | do something |-->| n = n+1 |--+
\ / +--------------+ +---------+
' '
| no
V
.------.
| Done |
'------'
n=1
while (n<5) {
do something
n += 1
}
.-----.
| Start |
'-----'
|
V
+-------+
| n = 1 |
+-------+
|<---------------------------------------------+
V |
' ' |
/ \ +--------------+ +---------+ |
' n<5? ' --yes--> | do something |-->| n = n+1 |--+
\ / +--------------+ +---------+
' '
| no
V
.------.
| Done |
'------' In flow chart, they are very similar (or the same if you want to). In coding, they are different because you need to control your loop. But remember that while can also be do-while too.