Menu
Question Index
...

What will be the output of the following program?

public class ATMTransaction {
    public static void main(String[] args) {
        int x;
        Double y;
        y = 10000;
        x = 9585;
        if (x % 5 == 0 && (y - x) >= .5)
            y = y - x - .50;
        System.out.println("Remaining = " + y);
    }
}


Remaining = 9585.0
Remaining = 9584.5
Remaining = 415.0
Remaining = 414.5
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Double Class And Java Float Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App