C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 6)
6.
By default a real number is treated as a
float
double
long double
far double
Answer: Option
Explanation:

In computing, 'real number' often refers to non-complex floating-point numbers. It include both rational numbers, such as 42 and 3/4, and irrational numbers such as pi = 3.14159265...

When the accuracy of the floating point number is insufficient, we can use the double to define the number. The double is same as float but with longer precision and takes double space (8 bytes) than float.

To extend the precision further we can use long double which occupies 10 bytes of memory space.

Discussion:
50 comments Page 3 of 5.

Cnu said:   1 decade ago
Double is used to define BIG floating point numbers.

Satyaveer Kumar said:   1 decade ago
Since the double type have long precision than float type, it has the larger value than the float. Hence, the statement inside the "if (a==b)" is false and hence the else statement got printed.

Aditya gupta said:   1 decade ago
Why can't be a floating point number?

Rahul jain said:   1 decade ago
What is difference between float and double ?

Aafreen said:   1 decade ago
Real number means all the numbers in the number line.. So, we never ever know the number after the number 1. It may be 1.00000000000000000000...

So, we can't define it as float due to small precision.
It can be defined using double/long double.

So, the answer double is correct.

Jony_jony_yes_papa said:   1 decade ago
Why not long double?

Ayush said:   1 decade ago
What is Big floating?

Shradha said:   1 decade ago
What is far double?

Shradha said:   1 decade ago
What is rational numbers?

Basu said:   1 decade ago
A rational number is a number that can be written as a ratio. That means it can be written as a fraction, in which both the numerator (the number on top) and the denominator (the number on the bottom) are whole numbers.


Post your comments here:

Your comments will be displayed after verification.