Java output type question

Q.  What output you will get if you run this program?
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);
}
}

- Published on 17 Jul 15

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

ANSWER: x mod 10 = 2
y mod 10 = 2.25
 

    Discussion

  • Aurora   -Posted on 17 Jun 20
    Article writing is also a fun, if youu be acquainted with afterward you can write otherwise it
    is difficult to write.
    web page lice bet betting match

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)