KnowledgeBoat Logo

Computer Applications

If int a=25, b=5, c=0; what value is stored in c when c = a%b?

  1. 5.0
  2. 5
  3. 0
  4. none

Java Operators

19 Likes

Answer

0

Reason — The expression uses mod operator (%) which returns the remainder after the operation. Here c = 25 % 5 which results in 0 as when 25 is divided by 5, we get the quotient as 5 and remainder as 0.

Answered By

5 Likes


Related Questions