M

Mr. Dubey • 53.53K Points
Coach

Q. What output you will get if you run this program?

Code:
class Modulus {
public static void main(String args[]) {
int x = 42;
double y = 42.25;
System.out.println("x mod 10 = " + x % 10);
System.out.println("y mod 10 = " + y % 10);
}
}
  • (A) x mod 10 = 2 y mod 10 = 2.25
  • (B) x mod 10 = 4 y mod 10 = 2.50
  • (C) x mod 10 = 6 y mod 10 = 3.25
  • (D) x mod 10 = 2 y mod 10 = 4.25
  • Correct Answer - Option(A)
  • Views: 107
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.

Learn All JAVA MCQs


Question analytics