Code: Select all
#include<stdio.h>
int main(){
float a=2.5;
printf("%f\n",a);
printf(" as int = %d \n as float = %f \n as hex = %x",a,a,a);
printf("\n%f",a);
return 0;
}
The output is
2.500000
as int = 0
as float = 0.000000
as hex = 40040000
2.500000
I used codeblocks 8.2 for compiling and it uses gcc I think.