I think that n1++
at line 19 makes it wrong
and perhaps suma should be in long long
just in case it overflows
First iteration:
n1 = 1, n2 = 1, n1 = 1, n0 = 1
1 is odd
Second iteration:
n1 = 2, n2 = 2, n1 = 3, n0 = 2
3 is odd
Third iteration:
n1 = 4, n2 = 4, n1 = 6, n0 = 4
6 is even
Fourth iteration:
n1 = 7, n2 = 7, n1 = 11, n0 = 7
11 is odd
Is 1, 3, 6, 11, ... the serie that you are looking for?