Possible Duplicate:
Why does printf print wrong values?
#include<stdio.h>
int main(int argc, const char *argv[]){
float f1 = 125.2f;
printf("\n [%f] [%d] [%g]",f1,f1,f1);
printf("\n [%f] [%g] [%d]",f1,f1,f1);
printf("\n [%g] [%f] [%d]",f1,f1,f1);
printf("\n [%g] [%d] [%f]",f1,f1,f1);
printf("\n [%d] [%g] [%f]",f1,f1,f1);
printf("\n [%d] [%f] [%g]",f1,f1,f1);
getchar();
}
I can see different output from each printf, though printing the same variable with same format identifier.