The flowchart gives most of the solution, you only have to translate the loop to something like a while() { ... } structure:
X=0
input num
while (num > 5) {
ouput num
X = X + num
num = num + 2
}
output X
If you run this with num = 8, it would print:
8
6
14