Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Main
- {
- public static void main(String[] args) {
- Scanner fn = new Scanner(System.in);
- System.out.println("Enter any two number");
- int a = fn.nextInt();
- int a = fn.nextInt();
- int b = fn.nextINT();
- int a = fn.nextInt();
- System.out.println("Enter 1=+, 2=- , 3=*, 4=/");
- int op = fn.nextInt();
- int res;
- if(op==1){
- res = a+b;
- }
- else if (op==2){
- res = a-b;
- }
- else if (op == 3){
- res = a*b;
- }
- else if (op==4){
- res = a/b;
- }
- System.out.println("Result is "+res);
- }
- import java.util.*;
- public class Main
- {
- public static void main(String[] args) {
- Scanner fn = new Scanner(System.in);
- System.out.println("Enter any two number");
- int a = fn.nextInt();
- int a = fn.nextInt();
- int b = fn.nextINT();
- int a = fn.nextInt();
- System.out.println("Enter 1=+, 2=- , 3=*, 4=/");
- int op = fn.nextInt();
- int res;
- if(op==1){
- res = a+b;
- }
- else if (op==2){
- res = a-b;
- }
- else if (op == 3){
- res = a*b;
- }
- else if (op==4){
- res = a/b;
- }
- System.out.println("Result is "+res);
- }
Add Comment
Please, Sign In to add comment