I have created following program to find the bit pattern of floating point no. but i got different then i calculated:
#include<stdio.h>
int main(void){
float f = 1.234;
char *ch;
ch = (char *)(&f);
printf("\n%d\n", *ch);
ch++;
printf("\n%d\n", *ch);
ch++;
printf("\n%d\n", *ch);
ch++;
printf("\n%d\n", *ch);
// printf("%d %d %d %d", *ch, *(ch+1), *(ch+2), *(ch+3));
printf("\n%f %e", f, f);
return 0;
}
It gives me output:
-74
-13
-99
63
1.234000 1.234000e+00
What does it mean because i was expecting bit pattern as:
00111111 10111011 11100111 0110110
where i am wrong please correct me