B

Bhagwan Das • 4.44K Points
Extraordinary

Q. What will be the output of the following Java code?
class Output 
{
     public static void main(String args[]) 
     {
         double x = 3.14;  
         int y = (int) Math.floor(x);
         System.out.print(y);
     }
}

  • (A) 0
  • (B) 3
  • (C) 3.0
  • (D) 4
  • Correct Answer - Option(B)
  • Views: 18
  • 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.


Question analytics