└── calculation java /calculation java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | import java.util.*; 3 | import java.text.*; 4 | import java.math.*; 5 | import java.util.regex.*; 6 | 7 | public class Solution { 8 | 9 | public static void main(String[] args) { 10 | Scanner s = new Scanner(System.in); 11 | int a = s.nextInt(); 12 | int b = s.nextInt(); 13 | char c =s.next().charAt(0); 14 | switch(c) 15 | { 16 | case '+': 17 | float a1 = (float)a+b; 18 | System.out.println("Addition of two number is "+a1); 19 | break; 20 | case '-': 21 | float a2 = (float)a-b; 22 | System.out.println("Subtraction of two number is "+a2); 23 | break; 24 | case '*': 25 | float a3 = (float)a*b; 26 | System.out.println("Multiplication of two number is "+a3); 27 | break; 28 | case '/': 29 | float a4 = (float)a/b; 30 | System.out.println("Division of two number is "+a4); 31 | break; 32 | case '%': 33 | float a5 = (float)a%b; 34 | System.out.println("Modulo of two number is "+a5); 35 | break; 36 | default: 37 | System.out.println("Invalid Input"); 38 | 39 | } 40 | 41 | /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ 42 | } 43 | } 44 | --------------------------------------------------------------------------------