C Quiz – 102 | Question 1
In the context of C data types, which of the followings is correct?
(A) “unsigned long long int” is a valid data type.
(B) “long long double” is a valid data type.
(C) “unsigned long double” is a valid data type.
(D) A), B) and C) all are valid data types.
(E) A), B) and C) all are invalid data types.
In C, “float” is single precision floating type. “double” is double precision floating type. “long double”is often more precise than double precision floating type. So the maximum floating type is “long double”. There’s nothing called “long long double”. If someone wants to use bigger range than “long double”, we need to define our own data type i.e. user defined data type. Besides, Type Specifiers “signed” and “unsigned” aren’t applicable for floating types (float, double, long double). Basically, floating types are always signed only.
But integer types i.e. “int”, “long int” and “long long int” are valid combinations. As per C standard, “long long int” would be at least 64 bits i.e. 8 bytes. By default integer types would be signed. If we need to make these integer types as unsigned, one can use Type Specifier “unsigned”. That’s why A) is correct answer.
Please Login to comment...