|
-
October 7th, 2004, 01:18 PM
#1
A strange C++ problem????
I have got a strange c++ problem in which the code is not behaving properly as it should.
The code is
#include<iostream.h>
#include<conio.h>
void main()
{ float a=0.7;
if(a<0.7)
cout<<"c";
else
cout<<"c++";
getch();
}
The problem is that for 0.7 it prints c and for any other value like 0.6 or 0.8 it prints c++ when both 0.7 numbers are replaced.
I can,t figure out how this is so.
Please help me as fast as you can
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|