Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SwitchCase {
- public static void main(String[] args){
- int num1, num2, result;
- Scanner input = new Scanner(System.in);
- System.out.println (" **** Arithemtic Operations****");
- System.out.println (" **** Switch case demo ****");
- System.out.println(" Enter two integers");
- num1= input.nextInt();
- num2= input.nextInt();
- System.out.println (" + ==> Additon - ==> Subtraction");
- System.out.println(" Enter your choice");
- char choice;
- choice = input.next().charAt(0);
- switch ( choice){
- case '+' :
- System.out.println( " Your choice is Addition");
- break;
- case '-' :
- System.out.println( " Your choice is Subtraction");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement