Menu
Question Index
...

What will be the output of the following program?

public class Price {
    public static void main(String[] args) {
        int quantity = 3;
        float type1 = 2.5F;
        double type2 = 12.3;
        System.out.println("Type1 price " + Math.scalb(type1, quantity));
        System.out.println("Type2 price " + Math.scalb(type2, quantity));
    }
}


Type1 price 7.5
Type2 price 36.9
Type1 price 20.0
Type2 price 98.4
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