package com.sudhirtheindian2.java123;
import java.util.Scanner;
public class arithmetic_operator {
    public static void main(String[] args) {
//    What is operator and arithmetic operator  with calculater example
//        operator
//        operator is a symbol that is used to perform
//                operatons according to user requirement
//        types of operator
//        arithmetic_operator
//         relational oprator
//         logical operator
//        arithmetic operator example
        int a,b,c,choice;
        System.out.println("enter the two number");
        Scanner scanner = new Scanner(System.in);
        a= scanner.nextInt();
        b= scanner.nextInt();
        System.out.println("enter your choice");
       choice= scanner.nextInt();
       switch (choice){
           case 1:
               c=a+b;
               System.out.println("addition "+c);
               break;
           case 2:
               c=a-b;
               System.out.println("subtraction "+c);
               break;
           case 3:
               c=a*b;
               System.out.println("multiply"+c);
               break;
           case 4:
               c=a/b;
               System.out.println("devide"+c);
               break;
           case 5:
               c=a%b;
               System.out.println("remainder"+c);
               break;
           default:
               System.out.println("this is wrong choice please choose right");
                 break;
       }
    }
}
 
टिप्पणियाँ
एक टिप्पणी भेजें