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 2 of 5.

Monu said:   6 years ago
Thanks for the explanation.

Jeevi said:   6 years ago
Thanks for all the information with clear explanation.

Rakripal said:   6 years ago
Very helpful notes. Thanks.

Karthi said:   7 years ago
Here, float a=1.1 (1.100000), double b=1.1 (1.10000000).

So, a==b evaluates to false.

Sangeethaj said:   7 years ago
This is a program very use get some knowledge how to programming compile what mean by "C" programming any important language send the email's.

Jenifer said:   7 years ago
Difference between float and double? Does the space is the only difference? Any one please tell me.

Sundar said:   8 years ago
Answer:

void main ()
{
float a=1.1;
if(a>1.1)
printf("welcome");
else
printf("bye");
getch();
}

Why the output is welcome please tell?

Float a=1.1 is considered float.

But, if (a>1. 1) there, 1.1 is real constant considered double. So, when using relation operators, type conversion accrued, the float convert to double, the padding accrued to value changed comparison time is not equal. Clearly you want, search about type conversion, how to changed the value in 0 1 padding time.

Lopa mandal said:   8 years ago
Double is a floating point data type with higher range of 8 bytes. Where as, long double is 10 bytes.

Shashiaknt rajiv made said:   8 years ago
What is double and long double?

Aditya tyagi said:   8 years ago
void main ()
{
float a=1.1;
if(a>1.1)
printf("welcome");
else
printf("bye");
getch();
}

Why the output is welcome please tell?


Post your comments here:

Your comments will be displayed after verification.