Computer Science, asked by pandeytushar2010, 10 months ago


15. What is the use and syntax of a ternary operator

Answers

Answered by sanjay3081
1

Explanation:

The ternary operator is used to execute code based on the result of a binary condition.

It takes in a binary condition as input, which makes it similar to an 'if-else' control flow block. It also, however, returns a value, behaving similar to a function

Answered by Anonymous
2

Answer:

A ternary operator can be used to replace a traditional if.. else statement block.

the basic syntax of a ternary operator is

condition ? value_if_block : value_else_block;

Hope you like it. :-)

Similar questions