public static void main(String[] args) { // TODO code application logic here double o,t,mum; Scanner sc=new Scanner(System.in); System.out.print("Input number1: "); o = sc.nextDouble(); System.out.print("Input +,-,*,/: "); mum = sc.next().charAt(0); System.out.print("Input number2: "); t = sc.nextDouble(); if(mum == '+'){ System.out.println("Sum : "+(o+t)); }else if(mum == '-'){ System.out.println("Sum : "+(o-t)); }else if(mum == '*'){ System.out.println("Sum : "+(o*t)); }else if(mum == '/'){ System.out.println("Sum : "+(o/t)); } }
Loading Info...