Hello,
I executed this program and output was "C". Can someone expain why it was output and not "C++". Thanks.
Code:int main(){ float a = 0.7; if(a < 0.7) printf("c"); else printf("c++"); }
Hello,
I executed this program and output was "C". Can someone expain why it was output and not "C++". Thanks.
Code:int main(){ float a = 0.7; if(a < 0.7) printf("c"); else printf("c++"); }
You should make an attempt at explaining it yourself. Think of what you know about floating point number representations.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I have put this question for help. If you know answer tell it to me.
The answer is "yes"
Seriously, read the homework guidelines. I already answered you in your other similiar homework thread.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Well. You can certainly see that school/uni/what-have-you has started up again.
What are the chances that "Stuart Dickson" is none other than sunil17 with a new username? Nearly the same MO.
Stuart, think about that big project, deadline hanging over your head, boss breathing down your neck ... and you have a problem you didn't bother to understand going in... You gonna run here and wait a couple of days for answers?
Here's a hint.... Try to accurately represent any fraction in binary...