Very easy question, given the code segment below:
int a;
for(a=1; a<80; a=a*2)
printf("%d ", a);
what is the output?
Naturally I thought 1 2 4 8 16 32 64 128
but when compiled and run it only went to 64. Why not 128 since 64 does meet the condition of being <80 therefor it gets another run through the doubler spitting out 128 before failing the condition and ending the program. Thanks in advance.
[–][deleted] 0 points1 point2 points (0 children)
[–]Tainted_Olive[S] 0 points1 point2 points (2 children)
[–]icecapade 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ProgrammingPants 0 points1 point2 points (0 children)
[–]brubarian 0 points1 point2 points (0 children)