C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - True / False Questions (Q.No. 2)
2.
A float is 4 bytes wide, whereas a double is 8 bytes wide.
True
False
Answer: Option
Explanation:

True,
float = 4 bytes.
double = 8 bytes.

Discussion:
5 comments Page 1 of 1.

Ankit said:   5 years ago
The size of float and double are depends from machine to machine.

Arnold said:   9 years ago
I disagree @Ajit.

Because { single precision float data type has 4 bytes while a double precision float data type has 8 bytes}.

Brajesh said:   10 years ago
I agree with @Ajit that since its compiler dependent so it must be false statement.

AdamK said:   1 decade ago
Neither C nor C++ standard fixes the width of float or double variables. IEEE 754 standard does include this but C99 only says "The set of values of the type float is a subset of the set of values of the type double; the set of values of the type double is a subset of the set of values of the type long double".

Ajit said:   1 decade ago
This is compiler dependent, so the answer should be false.

Post your comments here:

Your comments will be displayed after verification.