Sunday, October 24, 2021

Addition and Product of Two Numbers in Java

 A simple program that I wrote to ask the user to give two numbers, and then our program will compute the sum, and product of two numbers  using Java programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

package test; /* * Prof. Jake Rodriguez Pomperada, MAED-IT, MIT * www.jakerpomperada.com and www.jakerpomperada.blogspot.com * jakerpomperada@gmail.com * Bacolod City, Negros Occidental Philippines */ import java.util.Scanner; public class Addition_Product { public static void main(String[] args) { // TODO Auto-generated method stub int first=0, second=0; Scanner input = new Scanner(System.in); System.out.println(); System.out.println("\tAddition and Product of Two Numbers in Java"); System.out.println(); System.out.print("\tEnter First Number : "); first = input.nextInt(); System.out.print("\tEnter Second Number : "); second = input.nextInt(); int add = first + second; int product = first * second; System.out.println(); System.out.println("\tThe Sum of " + first + ", and " + second + " is " + add + "."); System.out.println(); System.out.println("\tThe Product of " + first + ", and " + second + " is " + product+ "."); System.out.println("\n"); System.out.print("\tEnd of Program \n"); System.out.println(); input.close(); } }

No comments:

Post a Comment