int main(){
float f=8.0;
if(f==8.0)
printf("good");
else
printf("bad");
}
what is the answere and explain it?
Answers were Sorted based on User's Feedback
Answer / c++ coder
Answer is "bad"
reason being, that when 8.0 is stored into the float
variable , it is never stored exactly as 8.0 because of
precision. Thus the comparsion will never evaluate to true.
It is always recommended not to do float, double
comparsions like this. :)
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / jayaraj.s
good is the result. because we declare and compare the same
value in the program.so alwaye if condition is true. we no
need to put else condition for these type of comparisions.
| Is This Answer Correct ? | 2 Yes | 3 No |
What oops means?
write aprogram for There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.
1 Answers iGate, Shashi, Source Bits, Subex,
why wipro wase
What is the difference between File pointer and Internal Charecter Pointer?
What is the function of this pointer?
0 Answers Agilent, ZS Associates,
how will you write a program on linked lists using JAVA programming???????????
what is meant by the "equivalence of pointers and arrays" in C?
how can write all 1to 100 prime numbers using for loop,if and break ?
write the program to find multiplication of 2-D matrix??????????
If fflush wont work, what can I use to flush input?
what are enumerations in C
what value is returned to operating system after program execution?