Why the condition evaluated to true ?
7/20/2020 10:49:47 PM
It might be useful to use the equality operator with the ternary operator
int c = b/a>=3 ? a:b;
result here is false, as 20/2 is 2 which means that the result is not greater or equal to 3
yes yes you are right thanks
i think there is no need for that in this situation
it was a question in one of challenges in Sololearn
20/10 is 2 and any number greater than 0 evalutes to True ,hence a is the answer
no worries, I would say Abhay answer is best as this is the reason it's true 👍
Abhay not Only greater than 0 is true but any non zero value evaluates true ... so that number less than zero also evaluates true..!
please how can I be a good programmer?
Mustafa Jafar first learn concept clearly and then do practice .
"practice makes man perfect"
so, keep practicing and practice will develop your logical thinking 👍
Send us a message