Hi I'm little confused Here is code
#include <iostream>
using namespace std;
int main(){
float a=182.52;
if(a==182.52f){
cout << "A";
}
else{
cout << "B";
}
return 0;
}
When i remove f literal from a==182.52f it's show me B as output because I need to convert 182.52 in float. Okay my question is that why I need to convert it to float? when I decreased 182.52 to 1.5 small values then it's working fine without f literal if it's binary size problem then why on input it's showing the same input value like below code.
#include <iostream>
using namespace std;
int main(){
float a;
cin >> a;
cout << a;
return 0;
}
why in the cin code it's showing the same output even when I input 182.52..!! May be my question confusing sorry for that..!!