Ternary Operators

The conditional operator (? :) is a ternary operator. This operator needs 3 operands to perform the operation.

Syntax:

Variable = <test expression> ? <expression 1> : <expression 2>

The conditional operator works as follows:

 Test Expression is Condition

 Expression 1 is Statement Followed if Condition is True

 Expression 2 is Statement Followed if Condition is False

The conditional operator (? :) is a ternary operator. This operator needs 3 operands to perform the operation.

Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2024 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz