In C/C++, which of the following data type is used to store real numbers?
Question
In C/C++, which of the following data type is used to store real numbers?
Solution
In C/C++, real numbers can be stored using the float and double data types.
-
float: This data type is used to store single precision floating point numbers or real numbers. It typically requires 32 bits of storage. -
double: This data type is used to store double precision floating point numbers or real numbers. It typically requires 64 bits of storage and provides more precision thanfloat.
So, if you want to store real numbers in your program, you can use either float or double depending on the level of precision you need.
Similar Questions
Which of the following is not a basic data type in C language?a.floatb.intc.chard.realClear my choice
Which data type is used for precise decimal calculations in C
What are the basic data types supported in C?
answerThe long data type in C is often used for:OptionsSmall integersSingle-precision floating-point valuesLarge integersDouble-precision floating-point values
Explain different datatypes in C
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.