what is a conditional operator explain with the help of an example
addyrocks1094:
sorry it is related to computer
Answers
Answered by
9
hiii dear
ur answer
An Example of Conditional Operators. The conditional operator "&&" first evaluates whether its first operand (i.e., number % 2 == 0) is true and then evaluates whether its second operand (i.e., number % 4 == 0) is true. As both are true, the logical AND condition is true.
⤴⤴⤴⤴⤴⤴⤴❤❤❤❤❤⤴⤴⤴⤴⤴
ur answer
An Example of Conditional Operators. The conditional operator "&&" first evaluates whether its first operand (i.e., number % 2 == 0) is true and then evaluates whether its second operand (i.e., number % 4 == 0) is true. As both are true, the logical AND condition is true.
⤴⤴⤴⤴⤴⤴⤴❤❤❤❤❤⤴⤴⤴⤴⤴
Answered by
9
Hi...Mate
Here is ur answer
A conditional operator in C#, is an operator that takes three operands (conditions to be checked), the value when the condition is true and value when the condition is false.
A conditional operator is represented by the symbol '?:'. The first operand (specified before the '?:') is the evaluating (conditional) expression.
examples
Consider this case:
int a = 10;
int b = 20;
int c = ((a < b ? 30 : 10;))THIS EXPRESSION SHOWS CONDITIONS
Here, expression-1 is : a<b
expression-2 is : 30
expression -3 is : 10
First, execute the condition if(a < b), based on its output (true/false), expression-2 or expression-3 will be executed.
HOPE IT HELPS YOU
PLEASE MARK BRAINLIEST
Here is ur answer
A conditional operator in C#, is an operator that takes three operands (conditions to be checked), the value when the condition is true and value when the condition is false.
A conditional operator is represented by the symbol '?:'. The first operand (specified before the '?:') is the evaluating (conditional) expression.
examples
Consider this case:
int a = 10;
int b = 20;
int c = ((a < b ? 30 : 10;))THIS EXPRESSION SHOWS CONDITIONS
Here, expression-1 is : a<b
expression-2 is : 30
expression -3 is : 10
First, execute the condition if(a < b), based on its output (true/false), expression-2 or expression-3 will be executed.
HOPE IT HELPS YOU
PLEASE MARK BRAINLIEST
Similar questions