194k views
1 vote
Write a complete main that will input a decimal number, double it and display the results

Write a complete main that will input a decimal number, double it and display the-example-1

1 Answer

3 votes

Answer:

No sure what language you want but since I am best with Java.

class Main {

public static void main(String[] args) {

Scanner input = new Scanner(System.in); // Create a Scanner object

System.out.println("Enter Number");

double number01 = input.nextLine(); // Read user input

double multi = number01 * 2;

System.out.println("Number is " + multi); // Output user input

}

}

Step-by-step explanation:

User Cooxie
by
4.5k points