A

Admin • 828.03K Points
Coach

Q. What will be the output of following java code?

Code:
public class Test{
public static void main(String args[]){
int a = 42;
double b = 42.25;
System.out.print((a%10)+" "+(b%10));
}
}
  • (A) 42 42.5
  • (B) 2 2.5
  • (C) 4.2 4.225
  • (D) 2 4.225
  • Correct Answer - Option(B)
  • Views: 14
  • Filed under category Java
  • Hashtags:

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.