+ 1

Please, Explain that why the output is coming '0' ? I was thinking that it should be '1'...

double a = 0.1; double b = 0.2; double c = 0.3; cout<<(a+b==c); // Output is 0 // How ?

3rd Jun 2019, 3:39 PM
Sp Maurya
Sp Maurya - avatar
6 Antworten
+ 1
But i have also tried to print them and the output was cout<<(a+b); (Output was 0.3) cout<<c; (Output was 0.3) How ? Is the printed values and the actual values are different ?
3rd Jun 2019, 4:01 PM
Sp Maurya
Sp Maurya - avatar
+ 1
The output was lol...😂 TYSM... i got it... 🤗🤗
3rd Jun 2019, 4:07 PM
Sp Maurya
Sp Maurya - avatar
0
i didnt get that can someone explain me
26th Jun 2019, 10:29 AM
Karan singh majila
Karan singh majila - avatar