C Programming - Floating Point Issues - Discussion

Discussion Forum : Floating Point Issues - General Questions (Q.No. 3)
3.
If the binary eauivalent of 5.375 in normalised form is 0100 0000 1010 1100 0000 0000 0000 0000, what will be the output of the program (on intel machine)?
#include<stdio.h>
#include<math.h>
int main()
{
    float a=5.375;
    char *p;
    int i;
    p = (char*)&a;
    for(i=0; i<=3; i++)
        printf("%02x\n", (unsigned char)p[i]);
    return 0;
}
40 AC 00 00
04 CA 00 00
00 00 AC 40
00 00 CA 04
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
117 comments Page 8 of 12.

Lordy said:   1 decade ago
Didn't understand even. Please explain further.

Siva said:   2 decades ago
Can you please give the explanation in detail?

Dheeraj said:   1 decade ago
Why we are using %02x? any one can explain me.

Shareen said:   1 decade ago
Thank you preethi for your clear explanation.

Tamil kudimagan said:   6 years ago
@Tayyaba explain clearly I can't understand.
(1)

Siri said:   1 decade ago
How to normalize a no can any one help me.

Shyam said:   10 years ago
Hi answer is C please any one can explain?

Sachin said:   1 decade ago
Intel processor store in reverse order.

Anuj said:   2 decades ago
Preethi's answer is absolutly correct.

John said:   1 decade ago
Can someone tell me how to normalise ?


Post your comments here:

Your comments will be displayed after verification.