Is the expressions
!(a ==b) a!=b equivalent?
i have yes here
!a && b b &&!a
yes
!a || b b ||!a
no
And how to write an if/else statement that stimulates the following expression:
z=(100>y) ? z*2 : z/2;
if (100>y)
z=z*2;
else
z-z/2;
what is z= and y= in the end?
i have z=40 and y=12
How to expand the expression y+=2
y=10, z=20
Output:
The value for !(a ==b) is: true
The value for (a!=b)) is:true
24
10
12
Additional: Some times (?:) conditional operator is a bit tricky this means that it takes three operands. Together, the operands and the ?: symbol form a conditional expression. The first operand (to the left of the ?) is a boolean expression (i.e., a condition that evaluates to a boolean valuetrue or false), the second operand (between the ? and :) is the value of the conditional expression if the boolean expression is True and the third operand (to the right of the :) is the value of the conditional expression if the boolean expression evaluates to false. For example, the statement: