Java Simple programme to do Multiplication

Java Simple programme to do Multiplication

Java Simple programme using to do some Multiplication. In this example we are going to use java.util.Scanner to take inputs and then multiply them to get result.

/*
* Java Programe to do
* simple Multiplication
*/
import java.util.Scanner;

class Multi{

public static void main(String []args){
float x,y,product;
Scanner in=new Scanner(System.in);
System.out.println(“Enter No. one”);
x=in.nextFloat();
System.out.println(“Enter No. two”);
y=in.nextFloat();

product=x*y;
System.out.println(“Product = ” +product);

}

}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Do you have any Query / Suggestion