Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Solution {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int a = sc.nextInt(),b=sc.nextInt();
- String operation = sc.next();
- if(operation=="+"){
- System.out.println(a+b);
- }else if(operation=="-"){
- System.out.println(a-b);
- }else if(operation=="*"){
- System.out.println(a*b);
- }else if(operation=="/"){
- System.out.println(a/b);
- }else{
- System.out.println("Invalid operation");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment