Menu
Question Index
...

What will be the output of the following program?

public class BiggestCircleInRectangle {

    public static void main(String[] args) {
        int width = 7, height = width * 2;
        int min = Math.min(width, height);
        int area = width * height - 22 / 7 * min / 2 * min / 2;
        System.out.print("area = " + area);
    }
}


area = 63
area = 59.5
Some other output
Compilation Error because height can not be assigned to width * 2.
Compilation Error for some other reason

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