I see that if-else is more convenient than ternary operators, so is there any specific advantage of ternary over if-else? Or just knowing the syntax of ?: statements would be enough?
Benifit of ternary over if/else
hey @ayushg1214, in modern day compilers, both are equally capable in computation. It is just about line of codes and readability of program
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.