Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java scanner equation

System.out.println("Enter the equation");
      double a = sc.nextDouble();
      char b = sc.next().charAt(0);
      double c = sc.nextDouble();
      System.out.println(a);
      System.out.println(b);
      System.out.println(c);
      if (b == '+')
      {
    	  System.out.println(a + c);
      }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #scanner #equation
ADD COMMENT
Topic
Name
5+9 =