{"id":1380,"date":"2022-03-03T19:10:29","date_gmt":"2022-03-03T19:10:29","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=1380"},"modified":"2022-03-03T19:10:29","modified_gmt":"2022-03-03T19:10:29","slug":"program-to-multiply-two-numbers","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/03\/03\/program-to-multiply-two-numbers\/","title":{"rendered":"Program to Multiply Two Numbers"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Program to read two integer and print product of them<\/h2>\n\n\n\n<p>This program asks user to enter two integer numbers and displays the product. To understand how to use scanner to take user input, checkout this program:\u00a0Program to read integer from system input.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.Scanner;\n\npublic class Demo {\n\n    public static void main(String&#91;] args) {\n\n        \/* This reads the input provided by user\n         * using keyboard\n         *\/\n        Scanner scan = new Scanner(System.in);\n        System.out.print(\"Enter first number: \");\n\n        \/\/ This method reads the number provided using keyboard\n        int num1 = scan.nextInt();\n        \n        System.out.print(\"Enter second number: \");\n        int num2 = scan.nextInt();\n\n        \/\/ Closing Scanner after the use\n        scan.close();\n        \n        \/\/ Calculating product of two numbers\n        int product = num1*num2;\n        \n        \/\/ Displaying the multiplication result\n        System.out.println(\"Output: \"+product);\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Enter first number: 15\nEnter second number: 6\nOutput: 90<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Program to read two integer and print product of them This program asks user to enter two integer numbers and displays the product. To understand how to use scanner to take user input, checkout this program:\u00a0Program to read integer from system input. Output:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[260],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/1380"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=1380"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/1380\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=1380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=1380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=1380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}