Menu
Question Index
...

What will be the output of the following program?

public class SecondNumeric
{
    public static void main(String args[])
    {
        mystery(19);
    }
    public static void mystery(int x)
    {
        int y = 0;
        while (x % 2 == 0)
        {
            y++;
            x = x / 2;
        }
        System.out.println(x + " " + y);
    }
}


4 3
3 4
0 0
19 0
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Methods - Parameter Passing And Scope

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App