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
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.
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 tyagi said:
1 decade ago
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;
if(a>1.1)
printf("welcome");
else
printf("bye");
getch();
}
Why the output is welcome please tell?
Klakston said:
1 decade ago
That question just only mentioned default real number so we using only float variable then why they used double. Just I need some more clarifications.
Sangeethaj said:
10 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.
Jaz said:
1 decade ago
@Cheluvarajesh
a==a or b==b means it comes I love you..
OR
a==b or b==a means it comes I hate you..
It checks the var equalization.
a==a or b==b means it comes I love you..
OR
a==b or b==a means it comes I hate you..
It checks the var equalization.
Ankit said:
1 decade ago
The numbers which are in set are 1, 2, 3. 1/2, 1/3, -. -1, -2. Etc are real nos.
By default its datatype is considered as doubled.
By default its datatype is considered as doubled.
Aman said:
1 decade ago
Hello Cheluvarajesh.
Double variable is always bigger than the Float variable whether the values are same.
Double variable is always bigger than the Float variable whether the values are same.
Kavitha said:
1 decade ago
Double variable have more precision.
for eg.,
6/36=0.166666666
So we can get more over approximate value
for eg.,
6/36=0.166666666
So we can get more over approximate value
Lopa mandal said:
1 decade ago
Double is a floating point data type with higher range of 8 bytes. Where as, long double is 10 bytes.
Jenifer said:
10 years ago
Difference between float and double? Does the space is the only difference? Any one please tell me.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers