#include <stdio.h>

void print_fib(int n)
{
    int a = 0;
    int b = 1;
    while (a < n)
    {
        int old_a = a;
        printf("%d ", a);
        a = b;
        b = old_a + b;
    }
}

int main()
{
    print_fib(500);
    printf("\n");
    return 0;
}

#include <stdio.h>

void print_fib(int n)
{
    int a = 0;
    int b = 1;
    while (a < n)
    {
        printf("%d ", a);

        int old_a = a;
        a = b;
        b = old_a + b;
    }
}

int main()
{
    print_fib(500);
    printf("\n");
    return 0;
}

--- 
+++ 
@@ -6,9 +6,8 @@
     int b = 1;
     while (a < n)
     {
+        int old_a = a;
         printf("%d ", a);
-
-        int old_a = a;
         a = b;
         b = old_a + b;
     }
Fix variable declaration non-conformant to C89

Declaring variables on C89 need to be done at the beginning of the
function scope. The old code failed on VS2010.