Problem in C++ program.....
Here is a program....
#include<iostream.h>
#include<conio.h>
void main()
{
float a=0.7;
cout<<a;
if(a<0.7)
{
cout<<"hello";
getch();
}
}
and the output is "0.7hello"
and here is another program....
#include<iostream.h>
#include<conio.h>
void main()
{
float a=1.7;
cout<<a;
if(a<1.7)
{
cout<<"hello";
getch();
}
}
and the output is "1.7" only.....
Can anyone give me the reason.....