I have the following python code:
a, b = 1, 1
for i in range(0, 100):
print a
a, b = b, a + b
It generates this: 1 1 2 3 5 8 etc
I wrote the same in c:
#include <stdio.h>
long long unsigned int a = 1, b = 1;
void main(){
for(int i = 0; i < 100; i++){
printf("%llu \n", a);
a = b, b = a + b;
}
}
It generates this: 1 1 2 4 8 16 32 etc
Why does the c program generate powers of 2 when it is using the exact same operations?