¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
What is the use of ternary operator in c++?
2 Respuestas
+ 8
Another way to write an if else part.
if (x==5)
cout << "howdy";
else
cout << "bye";
equals
cout << (x==5? "howdy": "bye");
+ 3
Its use is to allow using conditions in the middle of a statement