Ternary operator in C | Conditional operator in C programming

Опубликовано: 04 Октябрь 2024
на канале: Aptuts
86
1

In this video, I will teach you Conditional operator in C programming. The Conditional operator is also known as a Ternary operator in C.
Here is the syntax of the conditional operator:
Operand1 ? Operand2 : Operand3

Since this operator needs three operands, it is also called a Ternary operator.

Operand1 can be any expression that evaluates to TRUE or FALSE. Operand2 and Operand2 can be an expression or a value.
If Operand1 evaluates to TRUE, Operand2 is evaluated and the result is retuned. If Operand1 evaluates to FALSE, Operand3 is evaluated and the result is returned.

Useful links:
👉🏻 Subscribe Now - https://www.youtube.com/@aptuts?sub_c...
👉🏻 Learn the difference between compile time, run-time, and logical error -    • Difference between Compile-time, Run-...  
👉🏻 Arithmetic Operators in C++ -    • Arithmetic Operators in C++ : Explain...  
👉🏻 Increment and decrement operators in C/C++ -    • Increment & Decrement Operators | ++ ...  
👉🏻 Relational Operators -    • Relational operators in C & C++ (Hand...  

#ternaryoperator #conditionaloperator #cprogramming #c #programmingtutorial #aptuts