?
In C, which type of variable should be used to store decimal numbers?
Answer & Solution
Correct Answer:
Option
C
In C, you can indeed use the
So, to clarify:
If you require high precision and a wide range for storing decimal numbers, Option D:
Option C:
In summary, both
float data type to store decimal numbers. However, it's important to note that float is typically used for single-precision floating-point numbers, which have a lower precision and a more limited range compared to double.So, to clarify:
If you require high precision and a wide range for storing decimal numbers, Option D:
double is the more common choice.Option C:
float is a valid choice when you can tolerate slightly lower precision and a somewhat limited range, or when memory constraints are a concern, as float typically requires less memory than double.In summary, both
float and double can be used to store decimal numbers, but the choice between them depends on your specific requirements for precision and range.
Join the Discussion
Login to post a comment or share your explanation.
Login