Computer Science, asked by sameermuhammad7004, 7 months ago

Write a java code Write a program to get details about a car and display it. Hint: Store the price in double. When displaying, display the price correct to 2 decimal places.

Answers

Answered by vk8091624
1

Example 1: Round a Number using format

public class Decimal {

public static void main(String[] args) {

double num = 1.34567;

System.out.format("%.4f", num);

}

}

Similar questions