Java program to round the decimal to exact decimal place


Program
import java.util.*; public class RoundDecimal{ public static void main(String args[]){ Scanner s=new Scanner(System.in); Double decimal=s.nextDouble(); System.out.format("%.3f", decimal); } }
Input
Output