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 |
Is an array parameter is always "by reference" ?
What is indirection? How many levels of pointers can you have?
hi, which software companys will take,if d candidate's % is jst 55%?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
What is the -> in c?
what is the difference between 123 and 0123 in c?
what is the use of call back function in c?tell me with example
why we wont use '&' sing in aceesing the string using scanf
write a programming in c language, 1 3 5 7 9 11
what will be the output of this program main() { int i=1; while (i<=10); { i++; } }
What do you understand by normalization of pointers?
Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates