int main(){
float f=8.0;
if(f==8.0)
printf("good");
else
printf("bad");
}
what is the answere and explain it?
Answer Posted / 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 |
Post New Answer View All Answers
How to delete a node from linked list w/o using collectons?
Why c is called object oriented language?
What does a function declared as pascal do differently?
How many bytes is a struct in c?
which type of aspect you want from the student.
What are the different types of control structures in programming?
Explain Function Pointer?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
How can you increase the size of a statically allocated array?
Which is an example of a structural homology?
Hi can anyone tell what is a start up code?
What is a nested loop?
What is array in c with example?
What is the equivalent code of the following statement in WHILE LOOP format?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?