<<split from here>>
I have a question about the following code:
I switched the values for x and y so the sequence would display 0 as the first.Code:int x = 0, y = 1, z; int i; for ( i = 0; i < 10; i++ ) { printf ( "F(%d): %d\n", i, x ); z = x + y; y = x; x = z; }
I understand everything except
So when it runs through the first time, z becomes 0+1=1. but what I don't understand is how y=x and x=z..Code:z = x + y; y = x; x = z;
It seems to me that x equals 0, making y =0, then making z, which is 1 equal x. So you have 0 and 1 again.
Can anyone explain to me the logic of this sequence?



LinkBack URL
About LinkBacks


