Ofcourse you can simply compare float value with some numerical value , but just because you can , it doesn't mean you should. It's classical example of that .
There are many problems regarding storing exact floating point value in memory , due to hardware restrictions , this issue regarding storing exact floating point value in memory exist in virtually all the programming languages and platform . A better way to equating floating point values is checking if the difference of two values that you need to compare is less than some other very small number . In your code , you can implement that as ,
#include <iostream>
using namespace std;
const double EPSILON = 1e-5;
int main()
{
float a = 13.30;
if (abs(a - 13.30) < EPSILON)
cout << a;
else
cout << "5";
}
Now , this code will output 13.30 , here EPSILON is used as a very small double value to compare with the difference .
To know more about why this issue is prevalent read , Is-floating-point-math-broken and Why are floating point numbers inaccurate