[Solved] Why we use ‘?’ character in c# [duplicate]


? is not the operator, the combination of ? and : is the operator, called ‘ternary operator’.

The ternary operator is an operator that takes three arguments. The first argument is a comparison argument, the second is the result upon a true comparison, and the third is the result upon a false comparison. If it helps you can think of the operator as shortened way of writing an if-else statement.

solved Why we use ‘?’ character in c# [duplicate]