How do you shorten an IF condition?

To use a shorthand for an if else statement, use the ternary operator . The ternary operator starts with a condition that is followed by a question mark ? , then a value to return if the condition is truthy, a colon : , and a value to return if the condition is falsy. Copied!

Sizin İçin Seçtik  What is ternary operator in c with example?

Leave a Reply

Your email address will not be published. Required fields are marked *