mardi 6 avril 2021

Can anyone provide the logic why it is returning true? [duplicate]

    #include <iostream>
using namespace std;

int main() {
    float f =9.58;
    if(f<9.58)
    {
        cout<<"T";
    }
    else
    {
        cout<<"F";
    }
    return 0;
}

As per the logic, 9.58 is equal to 9.58 so it should return false but it is returning true.

Aucun commentaire:

Enregistrer un commentaire