You are not logged in.
- Index
- » Quiz Questions
- » Java Output:
- 0
Pages:: 1
#1 2015-06-10 06:48:07
Java Output:
Question:
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);
}
}
Option A):
x mod 10 = 4
y mod 10 = 2.50
Option B):
x mod 10 = 6
y mod 10 = 3.25
Option C):
x mod 10 = 2
y mod 10 = 2.25
Option D):
x mod 10 = 2
y mod 10 = 4.25
Correct Answer is Option C):
x mod 10 = 2
y mod 10 = 2.25
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-10 06:48:07
- Advertisement
- Ads By Google
Re: Java Output:
\n
Pages:: 1