First Situation
for (int i = 0 ; i <=2 ; i++)
{
cout << i << endl ;
}
output:
1
2
Second Situation
for (float i = 0 ; i <= 2 ; i+=.2)
{
cout << i << endl;
}
output
1
1.2
1.4
1.6
1.8
The question is why in the second situation he didn't take the 2 even i said ( <= ) and the funny thing if i remove the = the output will be even the same ?
Constrains i have to use the float DataType and i want to use the <= Operator