Garmaine Staff asked 1 year ago

I tried the below code i assigned a float value to variable and i compared it with a floating point value but it did not gave the desired output. Here as a==13.30 is true i thought it will print "a" instead it prints "5"

#include<iostream>
using namespace std;
int main()
{
    float a=13.30;
    if(a==13.30)
    cout<<a;
    else
    cout<<"5";

}

output is "5" not "a"