C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - True / False Questions (Q.No. 5)
5.
Range of double is -1.7e-38 to 1.7e+38 (in 16 bit platform - Turbo C under DOS)
True
False
Answer: Option
Explanation:

False, The range of double is -1.7e+308 to 1.7e+308.

Discussion:
5 comments Page 1 of 1.

Waled said:   1 year ago
It's not correct.

Because the compiler stored -1 in if condition as (256).

First any negative number compiler store these bumbers by gets the 1's complement of the number than 2's complement 1's of -1 is ob11111110 and 2's is 0b11111111 and this number is 256 therefore 256 sure greater than the return of size of int (4 bytes).

Naresh said:   7 years ago
main()
{
if(sizeof(int)>-1)
printf("yes");
else
printf("no");
}-

Can anyone please explain the output of this program with reason?

Prakash said:   8 years ago
If the range of double is -1.7e+308 to 1.7e+308.

Let us take 1.7e is x.

-x+308 to x+308.

Just give a value to x.

-1000+308 to 1000+308.

The range would be 308+308=616.

Pranay said:   9 years ago
Yes this is.

The Range of Double is -1.7e+308 to 1.7e+308.
The Range of Float is -3.4e+38 to 3.4 e+38.

Meda Vinod Kumar said:   1 decade ago
The Range of Double is -1.7e+308 to 1.7e+308.
The Range of Float is -3.4e+38 to 3.4 e+38.

Post your comments here:

Your comments will be displayed after verification.