if a=4 b=2 then find a*=a%b in java what will be the output
Answers
Answered by
2
- a = 0
- b= 2
Given:
> a = 4
> b = 2
On evaluating the expression:
> a *= a % b
> a *= 4 % 2
4 divided by 2 leaves 0 as remainder. Therefore:
> a *= 0
> a = a * 0
> a = 0
Therefore:
> a = 0
> b = 2
Operators: An operator is a symbol used to perform arithmetical or logical operations.
Types of Operators In Java:
Basically, there are three types of operators.
- Arithmetical Operator.
- Relational Operator.
- Logical Operator.
Other operators include -
- Unary, binary and ternary operator.
- Bitwise operator and so on.
Similar questions