closed by
375 views
0 votes
0 votes
closed with the note: Irrelevant for GATE, please see https://gateoverflow.in/blog/2113/new-posting-guidelines
Explain in detail how and what conversion(in binary bit pattern) takes place for following codes:

1) int i=37;

    float f=*(float *)&i;

    printf("f=%f",f);     [Output:f=0.000000]

2)float f=7.0;

short s=*(short *)&f;

printf("s=%hd",s);      [Output:s=0]
closed by

Related questions

2 votes
2 votes
1 answer
1
Hitoshi asked Dec 19, 2017
4,831 views
If the decimal number is 3.248 x 104 ,then its equivalent floating number in IEEE 754 standard is ?
1 votes
1 votes
1 answer
2
Aboveallplayer asked Jan 18, 2017
1,788 views
what is the hexadecimal representation of the floating point number (-48.625) in single precision, after rounding off and normalisation
5 votes
5 votes
2 answers
4
gate_forum asked Oct 14, 2015
1,271 views
32 bit floating point representation of decimal number 3.284*10^4 is(A) 010001101111110111000000000000(B) 110001101111110111000000000000(C) 011010101111110111000000..(D) ...