Menu
Question Index
...

What will be the output of the following program?

public class Numeric
{
    public static void main(String args[])
    {
        mystery(-99);
    }
    public static void mystery(int n)
    {
        if(n > 10)
        {
            n = n / 2;
        }
        else
        {
            n = n + 7;
        }
        if (n * 2 < 25)
        {
            n = n + 10;
        }
        System.out.println(n);
    }
}


99
-82
55
111
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