Menu
Question Index
...

What will be the output of the following program?

import java.util.*;
public class PercentageFormat {
    public static void main(String[] args) {
        double percentage = 75.65;
        Formatter f = new Formatter();
        f.format("%f ", percentage);
        f.format("%e ", percentage);
        System.out.println(f);
    }
}


75.650000 7.56e+04
75.650000 7.565000e+01
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Formatting Numbers

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App