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. Let’s take three numbers from user. If the numbers are two then find maximum from that numbers are much easier by using Ternary Operator as formula int max = num1 > num2 ? num1 : num2; But we have three numbers, so that it is a…