Showing posts with label Product of Two Numbers in Java Using Scanner Library. Show all posts
Showing posts with label Product of Two Numbers in Java Using Scanner Library. Show all posts

Sunday, May 17, 2015

Product of Two Numbers in Java Using Scanner Library

In this article I would like to share with you a very simple program that I wrote in Java I called this program Product of Two Numbers in Java Using Scanner Library. I am just a beginner in terms of using Eclipse Java IDE text editor while I'm learning how to create a project I just wrote this very simple program that will ask the user to enter two numbers and then it will display the product of the two numbers to the user.

I find the eclipse ide editor easy to use and user friendly in a sense it display a command while you are type your code it is called intellisense function that can be found in Microsoft Visual Studio.

I hope you will my work useful and learning Java programming. If you have some questions feel free to send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines who wish to contact me you can text or call me at this number 09173084360.

Thank you very much and God Bless.



Sample Program Output

Program Listing

package demo;

import java.util.Scanner;

public class Demo {

 public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Product of Two Numbers");
System.out.print(" Enter first value : ");
int val1 = scan.nextInt();
System.out.print(" Enter second value : ");
int val2 = scan.nextInt();
int product = val1 * val2;
System.out.print("The product of "+ val1  + " and " 
+ val2 + " is " + product + ".");
     } 


}