if we set float and double type to NaN then they are not equal to anything including themselves. can such a thing happens for
NaN is the only value for a==a return false.
a==a
And int doesn't support a NaN value. So no you can't have this situation with int.
int
Another note, to check if a value is NaN you should use isnan() not a==a.
isnan()