How to enter double values in java

//How to enter double values in java

import java.util.*;
public class M
{
public static void main(String args[])
{
double a;
System.out.println("Enter the value of a : ");
Scanner sc=new Scanner(System.in);
a=sc.nextDouble();
System.out.println("You entered: "+a);
}
}


OUTPUT:
Enter the value of a :
20.2145
You entered: 20.2145

No comments:

Post a Comment