6 Answers
New AnswerBecause floating point numbers has certain accuracy of representation. So in fact a is represented as 0.6999...... That's why a < 0.7 and "C" is printed. Look at the code and the actual value of variable "a". Hope it helps you 😉 https://code.sololearn.com/c0IdhHFKo9A5/?ref=app
Siddharth Jain, just double type variables have better accuracy and that's why it'll print "C++".
Siddharth Jain , in fact if you change the type of variable "a" to double you'll get a better accuracy and then it'll print "C++" on screen.
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message