Computer Science, asked by MohammadShamam, 15 days ago

if a=4 b=2 then find a*=a%b in java what will be the output​

Answers

Answered by anindyaadhikari13
2

\texttt{\textsf{\large{\underline{Answer}:}}}

  • a = 0
  • b= 2

\texttt{\textsf{\large{\underline{Explanation}:}}}

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

\texttt{\textsf{\large{\underline{Learn More}:}}}

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.  

  1. Arithmetical Operator.
  2. Relational Operator.
  3. Logical Operator.

Other operators include -  

  1. Unary, binary and ternary operator.
  2. Bitwise operator and so on.
Similar questions