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 |
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
What is scope and lifetime of a variable in c?
What is the use of header files?
what is the structure pointer?
Write a c program to find, no of occurance of a given word in a file. The word is case sensitive.
int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p?
Explain the difference between fopen() and freopen().
3. Program to print all possible substrings. ex: String S St Str Stri Strin String t tr tri trin tring r
Explain threaded binary trees?
Can i use “int” data type to store the value 32768? Why?
Explain Linker and Loader
What is the ANSI C Standard?