java Two_Number_Sum_Product_Difference

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java Two_Number_Sum_Product_Difference相关的知识,希望对你有一定的参考价值。

package BASICJAVA;

import java.util.Scanner;

/**
 *
 * @author ABIR
 */
public class Two_Number_Sum_Product_Difference {
    public static void main(String[]args){
        Scanner abir =new Scanner(System.in);
        System.out.println("Enter your first number");
        int number1=abir.nextInt();
        System.out.println("Enter your second number");
        int number2=abir.nextInt();
        int sum =number1+number2;
        System.out.println("your sum is = "+ sum);
        int product =number1*number2;
        System.out.println("your product is = "+ product);
        int dif =number1-number2;
        System.out.println("your difference is = "+ dif);
    }
}

以上是关于java Two_Number_Sum_Product_Difference的主要内容,如果未能解决你的问题,请参考以下文章

Java 布尔运算

java [Java] Java常用代码#java

Java - 35 Java 实例

Java While 循环

Java 字符串

Java If ... Else