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 |
The file stdio.h, what does it contain?
what is the hardware model of CFG( context free grammar)
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
character array A[12] can hold
A stack can be implemented only using array?if not what is used?
How Many Header Files in c?
How can I find out if there are characters available for reading?
what is the associativity of bitwise OR operator?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
Differentiate between ordinary variable and pointer in c.
7. Identify the correct argument for the function call fflush() in ANSI C: A)stdout B)stdin C)stderr D)All the above
What is strcpy() function?