Wednesday, July 19, 2017

Difference Program

/*A program that displays the difference between two integer numbers.
Created by Eyasu Mulugeta A.K.A BlackDiamond0014 on 6/23/2017.
eyasu@india.com

*/import java.util.Scanner; public class SubtractTwoNumbers { public static void main(String[] args) { int num1, num2; Scanner s = new Scanner(System.in); System.out.println("\n\n\t\t\t# # # # Subtraction Program # # # #\n\n"); System.out.print("Please enter the first number : "); num1=s.nextInt(); System.out.print("Please enter the second number : "); num2=s.nextInt(); System.out.println("\nThe difference of "+num1+" and "+num2+ " is "+(num1-num2)+"."); } }
Share: