Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CommaNumber {
- public static void main(String[] args) {
- double x; // Declaring a double
- Scanner keyboardinput = new Scanner(System.in); // Input a double with the keyboard
- System.out.println("Write a number with a comma."); // Message for user
- x = keyboardinput.nextDouble();
- double y = 1.0 / x; // Declare another double equal to 1.0 over x
- System.out.println(x);
- System.out.println(y);
- System.out.println(x*y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement