S

Sandhya Thakur • 4.08K Points
Extraordinary

Q. What will be the output of the following Java program?

Code:
class increment 
{
    public static void main(String args[])
    {
        double var1 = 1 + 5; 
        double var2 = var1 / 4;
        int var3 = 1 + 5;
        int var4 = var3 / 4;
        System.out.print(var2 + " " + var4);

    } 
}
  • (A) 1 1
  • (B) 0 1
  • (C) 1.5 1
  • (D) 1.5 1.0
  • Correct Answer - Option(C)
  • Views: 15
  • 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