Computer Science, asked by aysha8646, 8 hours ago

If int a=55,b=9, c=0; and c=a%b, the value stored in c will be

Answers

Answered by anindyaadhikari13
1

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

  • The value of c is 1.

\texttt{\textsf{\large{\underline{Why ?}:}}}

Given:

> a = 55

> b = 9

The modulo operator is used to find the remainder obtained when a number is divided by another number.

∵ 55 = 9 × 6 + 1

> c = a % b

> c = 55 % 9

> c = 1

Hence: The value of c is 1.

\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