Why is the value of n changing to garbage inside the for-loop? (I'm new to C language, I come from a C++ background)
float n = 3.0;
printf ("%f\n", n);
for (; n <= 99.0; n += 2)
printf ("%f\n", &n);
You are printing the address of n (&n
) inside the for-loop. Get rid of the &