Menu
Question Index
...

What will be the output of the following program?

public class rechargeDenomination {
    public static void main(String[] args) {
        int procFees = 3;
        long recharge = 50;
        float serviceTax = 5.5f;
        double callingValue = 41.5D;
        System.out.print(Math.max(procFees, recharge) + " ");
        System.out.print(Math.max(recharge, serviceTax) + " ");
        System.out.print(Math.max(serviceTax, callingValue) + " ");
        System.out.print(Math.max(callingValue, procFees));
    }
}


50 50.0 41.5 41.5
50.0 50.0 41.5 41.5
50 50 41.5 41.5
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Math Class - java.lang.Math

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App