MCQs
Explanation:In this program, the value e is evaluated by precedence ad we got the output as 50.
Output:
$ g++ ess4.cpp
$ a.out
50
None.
| operator is used to find the 'or' of given values.
None.
&& is called as Logical AND operator, if there is no zero in the operand means, it will be true
We are using the ternary operator to evaluate this expression. It will return first option, if first
condition is true otherwise it will return second
Output:
$ g++ ess1.cpp
$ a.out
7
None.
In this program, we are reassigning the values of a and b because of this we got the output as a:4 b:7
Output:
$ g++ ess.cpp
$ a.out
a:4 b:7
In assignment operation, the flow of execution will be from right to left only.
When we want to modify the value of a variable by performing an operation on the value currently
stored, We will use compound assignment statement. In this option, a -=5 is equal to a = a-5.