I'm writing this program for yet another home work and I'm stuck on a very small part of it. I wrote a short separate program that includes my problem. I added the program and what I get when I run it.
the problem is with the last number on the second line.
instead of "1234567" I get "1247038" and I have no idea where that number comes from.
if I replace the 'i' with a '0' in the end of the "x_i6=..." line then everything works fine, but if I put back the 'i' (which is 0 in the 1st time the "for" runs) then this specific number returns.
and what's even stranger is if print the 'i' with printf before doing the calculations then it also works fine, even though I don't change anything.