Ask Question
22 December, 00:07

Write a program that accepts a whole number as input, multiplies that number by 12, and then outputs the product

+5
Answers (1)
  1. 22 December, 00:10
    0
    The program accepts a whole number as input, multiplies that number by 12, and then outputs the product

    Explanation:

    This program asks user to enter two integer numbers and displays the product.

    The scanner class is used as input functions.

    The code is shown below:

    import java. util. Scanner;

    public class Demo {

    public static void main (String[] args) {

    Scanner scan = new Scanner (System. in);

    System. out. print ("Enter number: ");

    int num1 = scan. nextInt ();

    scan. close ();

    int product = num1*12;

    System. out. println ("Output: "+product);

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program that accepts a whole number as input, multiplies that number by 12, and then outputs the product ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers